House Prices - à la Kaggle

Ask a home buyer to describe their dream house, and they probably won’t begin with the height of the basement ceiling or the proximity to an east-west railroad. But this playground competition’s dataset proves that much more influences price negotiations than the number of bedrooms or a white-picket fence.
With 79 explanatory variables describing (almost) every aspect of residential homes in Ames, Iowa, this competition challenges you to predict the final price of each home.

Deliverables:
Your group is to turn in a paper that is no more that 7 pages long (without the appendix). Please put your code in the appendix, but any graphs and tables in the body of the paper.

Sample Format
Required deliverables in the complete report. The format of your paper (headers, sections, etc) is flexible although should contain the following information:

Introduction

Data Description
(Where did the data come from? How big is it? How many observations? Where can we find out more? What are the specific variables that we need to know to understand with respect to your analysis?)

Analysis Question 1:
Restatement of Problem

Specify the Model  
   
Checking Assumptions   
    Residual Plots   
    Influential point analysis (Cook’s D and Leverage)  
    Make sure and address each assumption.  

Comparing Competing Models  
    adj R2    
    Interval CVPress    
  
Parameter Interpretation  
    Interpretation   
    Confidence Intervals   

Conclusion
A short summary of the analysis.

Analysis Question 2
Restatement of Problem

Estimating market value of a home for sale has significant implications for all parties involved in the transaction : seller, buyer, agents, mortgage providers and even local taxing authorities. Getting it right can improve local economies. Inefficiencies associated to historical methods of value assessments create hesitation on the part of buyers and lenders, and potential loss of revenue for sellers and agents. Developing a model that considers all available factors and provides a transparent valuation that can be shared among all parties in the transaction can enable the participants to proceed with increased confidence, thus increasing the velocity of the local real estate market. That is the purpose of this evaluation : use all available contributing factors for the residnetial real estate market in Ames, Iowa and create a predicitve model to better estimate market valuation for future properties to be proposed for sale.

For this evaluation, there are seventy-nine explanatory variables available for exploitation, based on residential sales in the years 2006 trough 2010, comprising approximately 1500 sales. The explanatory variables include traditional expected characteristics, such as : neighborhood, square footage, number of bedrooms, number of bathrooms, etc. and also several factors that are perhaps considered secondary or tertiary, but are included in the modeling to increase predictive capability. Some of these additional factors include : heating type, number of fireplaces, qualitative assessment of the kitchen condition.

In order to build the model, the following steps are taken : + read in the raw training data set provided,
+ basic cleaning of the data, including removing significant outliers (for this purpose, more than 5 std deviations from mean)
+ imputing values for features where none was provided (for this purpose, setting to min value for numeric features, and creating a new factor level “None” for categorical features),
+ plot and visually examine each feature in relation to log(SalePrice) …
++ this provides a basis for removing some features from consideration based on inspection
++ some features may have 1400 / 1460 within same cateegory, thus not providing varaibility worthwhile including in a model
++ some numerical features are sparesely populated, and the the few values visually exhibit zero slope in relation to log(SalePrice)
++ a new feature was created “saledate” from the “year sold” and “month sold” features. Upon visual examination, there was no obvious trend in the time series view for log(SalePrice)s, so this was eventually discarded (surprisingly, considering that the time period spanned the economic downturn to 2007 - 2009).
++ this visual examination then results in eliminating approximately 25 of the features from consideration in the model.

Models Considered

one from forward selection, one from backwards elimination, one from stepwise selection and one that you build custom. The custom model could be one of the three preceding models or one that you build by adding or subtracting variables at your will.

Generate an adjusted R2, CV Press and Kaggle Score for each of these models and clearly describe which model you feel is the best in terms of being able to predict future sale prices of homes in Ames, Iowa.

Model Selection
Type of Selection
Stepwise
Forward
Backward
CUSTOM

    Checking Assumptions   
        Residual Plots  
        Influential point analysis (Cook’s D and Leverage)  
        Make sure and address each assumption  

    Comparing Competing Models  
        Adj R2     
        Interval CVPress     
        Kaggle Score   

    Conclusion: A short summary of the analysis.    
  

Appendix
Well commented SAS Code for Analysis 1 and 2

Rubric:
Presentation (30%):
Organized paper with title, headings, subheadings, etc.
Labeled plots, figures, tables and charts.
Every plot, figure, table and chart included is referenced in the paper and vice versa.
No spelling or grammatical errors.
Analysis Question 1: (35%)
Analysis Question 2: (35 %)

    setwd(data_dir)
    homes <- read.csv("train.csv", stringsAsFactors = FALSE)
    setwd(home_dir)

    names(homes) <- tolower(names(homes))
    
    for (i in 2:(length(homes)))
    {
        if (class(homes[,i]) == "character")
        {
            homes[,i] <- factor (homes[,i])
        }
    }
    

# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   remove outliers ... more than 5 sigma from mean value
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    
    lst <- length(homes) - 1    # sale price is (currently) last column
    
    for (i in 2 : lst)
    {
        if(class(homes[,i]) == "integer" || class(homes[,i]) == "numeric")
        {
            homes[,i][which(scale(homes[,i]) > 5)] <- NA
            homes[,i][which(scale(homes[,i]) < -5)] <- NA
        }
    }

# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   create a few new columns
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    dates <- paste(homes$yrsold, sprintf("%02d", homes$mosold), "01")
    homes$sale_date <- as.Date(dates, "%Y %m %d")
    
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   scale each column independently
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

#   for (i in 2 : length(homes))
#   {
#       if(class(homes[,i]) == "integer" || class(homes[,i]) == "numeric")
#       {
#           homes[,i] <- scale(homes[,i])
#       }
#   }

# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   make some plots for numberic variables... linear, log_x, log_y, log_xy ...
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

#   pdf ("homes_train_plots.pdf", width = 10, height = 7)

    par (mfrow = c (2, 3))
    for (i in 2:(length(homes)))
    {
        if(class(homes[,i]) == "integer" || class(homes[,i]) == "numeric" || class(homes[,i]) == "matrix")
        {
            plot (homes[,i], main = (names(homes[i])))
            hist(homes[,i])
            plot(log(homes$saleprice)  ~ homes[,i])
        }
    }

    par (mfrow = c (2, 2))

    for (i in 2:(length(homes)))
    {
        if(class(homes[,i]) == "factor")
        {
            plot_title <- names(homes[i])

            p <- ggplot(homes, aes(x = homes[,i], fill = homes[,i])) + geom_bar() + labs(title = plot_title)
            print(p)

            p <- ggplot(homes, aes(x = homes[,i], y = log(saleprice), fill = homes[,i])) + geom_boxplot() + labs(title = plot_title)
            print(p)
        }
    }   

            plot(homes$saleprice ~ homes$sale_date)

#   dev.off()
    
    for (i in 2:(length(homes)))
    {
        if(class(homes[,i]) == "integer" || class(homes[,i]) == "numeric" || class(homes[,i]) == "matrix")
        {
            fit <- lm(homes$saleprice ~ homes[,i])
            
            print(sprintf(" ... %3d : %20s | r^2 = %8.3f | p-value = %12.4e",
                          i, names(homes[i]), summary(fit)$r.squared, summary(fit)$coefficients[,4][2] ))
        }
    }
## [1] " ...   2 :           mssubclass | r^2 =    0.007 | p-value =   1.2665e-03"
## [1] " ...   4 :          lotfrontage | r^2 =    0.145 | p-value =   9.6021e-43"
## [1] " ...   5 :              lotarea | r^2 =    0.140 | p-value =   1.1041e-49"
## [1] " ...  18 :          overallqual | r^2 =    0.626 | p-value =  2.1857e-313"
## [1] " ...  19 :          overallcond | r^2 =    0.006 | p-value =   2.9124e-03"
## [1] " ...  20 :            yearbuilt | r^2 =    0.273 | p-value =  2.9902e-103"
## [1] " ...  21 :         yearremodadd | r^2 =    0.257 | p-value =   3.1649e-96"
## [1] " ...  27 :           masvnrarea | r^2 =    0.214 | p-value =   2.1244e-77"
## [1] " ...  35 :           bsmtfinsf1 | r^2 =    0.166 | p-value =   2.4724e-59"
## [1] " ...  37 :           bsmtfinsf2 | r^2 =    0.003 | p-value =   4.8072e-02"
## [1] " ...  38 :            bsmtunfsf | r^2 =    0.046 | p-value =   1.1830e-16"
## [1] " ...  39 :          totalbsmtsf | r^2 =    0.417 | p-value =  6.3610e-173"
## [1] " ...  44 :            x1stflrsf | r^2 =    0.395 | p-value =  6.7032e-161"
## [1] " ...  45 :            x2ndflrsf | r^2 =    0.102 | p-value =   5.7643e-36"
## [1] " ...  46 :         lowqualfinsf | r^2 =    0.003 | p-value =   2.7800e-02"
## [1] " ...  47 :            grlivarea | r^2 =    0.519 | p-value =  1.9399e-233"
## [1] " ...  48 :         bsmtfullbath | r^2 =    0.052 | p-value =   1.5503e-18"
## [1] " ...  49 :         bsmthalfbath | r^2 =    0.000 | p-value =   5.7466e-01"
## [1] " ...  50 :             fullbath | r^2 =    0.314 | p-value =  1.2365e-121"
## [1] " ...  51 :             halfbath | r^2 =    0.081 | p-value =   1.6505e-28"
## [1] " ...  52 :         bedroomabvgr | r^2 =    0.029 | p-value =   7.2242e-11"
## [1] " ...  53 :         kitchenabvgr | r^2 =    0.018 | p-value =   1.9184e-07"
## [1] " ...  55 :         totrmsabvgrd | r^2 =    0.285 | p-value =  2.7723e-108"
## [1] " ...  57 :           fireplaces | r^2 =    0.218 | p-value =   6.1415e-80"
## [1] " ...  60 :          garageyrblt | r^2 =    0.237 | p-value =   8.7051e-83"
## [1] " ...  62 :           garagecars | r^2 =    0.410 | p-value =  2.4986e-169"
## [1] " ...  63 :           garagearea | r^2 =    0.389 | p-value =  5.2650e-158"
## [1] " ...  67 :           wooddecksf | r^2 =    0.107 | p-value =   9.8439e-38"
## [1] " ...  68 :          openporchsf | r^2 =    0.115 | p-value =   1.9621e-40"
## [1] " ...  69 :        enclosedporch | r^2 =    0.020 | p-value =   4.9036e-08"
## [1] " ...  70 :           x3ssnporch | r^2 =    0.000 | p-value =   9.2444e-01"
## [1] " ...  71 :          screenporch | r^2 =    0.007 | p-value =   1.6782e-03"
## [1] " ...  72 :             poolarea | r^2 =    0.000 | p-value =           NA"
## [1] " ...  76 :              miscval | r^2 =    0.000 | p-value =   4.2297e-01"
## [1] " ...  77 :               mosold | r^2 =    0.002 | p-value =   7.6128e-02"
## [1] " ...  78 :               yrsold | r^2 =    0.001 | p-value =   2.6941e-01"
## [1] " ...  81 :            saleprice | r^2 =    1.000 | p-value =   0.0000e+00"
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   Columns to remove - based on visual inspection
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    
    homes_subset <- subset(homes, select = -c(
        id,
        mssubclass,
        street,
        alley,
        utilities,
        condition2,
        roofmatl,
        centralair,
        bsmtfinsf2,
        fence,
        miscfeature,
        lowqualfinsf,
        bsmthalfbath,
        kitchenabvgr,
        x3ssnporch,
        screenporch,
        garagequal,
        garagecond,
        paveddrive,
        poolarea,
        poolqc,
        miscval,
        mosold,
        yrsold,
        exterior2nd,
        bsmtcond,
        bsmtfintype1,
        garagefinish ))

# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   Impute NAs to functional value
# ...
# ...   --> for numerical variables - impute to min value in
# ...   --> for factor variables - create new factor "None"
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    for (i in 2 : (length(homes_subset)))
    {
        if(class(homes_subset[,i]) == "integer" || class(homes_subset[,i]) == "numeric" || class(homes_subset[,i]) == "matrix")
        {
            homes_subset[,i][is.na (homes_subset[,i])] <- min (homes_subset[,i], na.rm = TRUE)
        }
    }
    
    for (i in 2:(length(homes_subset)))
    {
        if(class(homes_subset[,i]) == "factor")
        {
            levels <- levels(homes_subset[,i])
            levels[length(levels) + 1] <- "None"
            homes_subset[,i] <- factor(homes_subset[,i], levels = levels)
            homes_subset[,i][is.na (homes_subset[,i])] <- "None"
        }
    }
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
    homes_subset$log_saleprice <- log(homes_subset$saleprice)
    
    homes_subset <- subset(homes_subset, select = -c(saleprice, sale_date))
    
    sas_dir <- "~/sas/SASUniversityEdition/myfolders/"
    setwd(sas_dir)
    write.csv (homes_subset, file = "training_set_cleaned.csv", row.names = FALSE)
    setwd(home_dir)

# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   save base data set for multiple solution options
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    homes_subset_base <- homes_subset

# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   base model on all candidate features
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    
    df_fits <- data.frame(row = integer(0), feature = character(0), r_squared = numeric(0), stringsAsFactors = FALSE)
    
    for (i in 1 : (length(homes_subset)))
    {
            fit <- lm(homes_subset$log_saleprice ~ homes[,i])
            
            print(sprintf(" ... %3d : %20s | r^2 = %8.3f | p-value = %12.4e",
                          i, names(homes_subset[i]), summary(fit)$r.squared,
                                summary(fit)$coefficients[,4][2] ))
            
            next_row <- data.frame(row = i, feature = names(homes_subset[i]),
                                   r_squared = summary(fit)$r.squared)
            df_fits <- rbind(df_fits, next_row)
    }
## [1] " ...   1 :             mszoning | r^2 =    0.000 | p-value =   4.9332e-01"
## [1] " ...   2 :          lotfrontage | r^2 =    0.005 | p-value =   4.6924e-03"
## [1] " ...   3 :              lotarea | r^2 =    0.176 | p-value =   1.9076e-19"
## [1] " ...   4 :             lotshape | r^2 =    0.146 | p-value =   4.7860e-43"
## [1] " ...   5 :          landcontour | r^2 =    0.135 | p-value =   1.3152e-47"
## [1] " ...   6 :            lotconfig | r^2 =    0.003 | p-value =   2.8379e-02"
## [1] " ...   7 :            landslope | r^2 =    0.233 | p-value =   1.2771e-06"
## [1] " ...   8 :         neighborhood | r^2 =    0.088 | p-value =   1.2705e-02"
## [1] " ...   9 :           condition1 | r^2 =    0.026 | p-value =   2.4920e-09"
## [1] " ...  10 :             bldgtype | r^2 =    0.000 | p-value =   6.2961e-01"
## [1] " ...  11 :           housestyle | r^2 =    0.023 | p-value =   3.1203e-06"
## [1] " ...  12 :          overallqual | r^2 =    0.001 | p-value =   2.6693e-01"
## [1] " ...  13 :          overallcond | r^2 =    0.571 | p-value =   8.2381e-02"
## [1] " ...  14 :            yearbuilt | r^2 =    0.042 | p-value =   2.8360e-01"
## [1] " ...  15 :         yearremodadd | r^2 =    0.012 | p-value =   7.5694e-01"
## [1] " ...  16 :            roofstyle | r^2 =    0.040 | p-value =   6.6850e-06"
## [1] " ...  17 :          exterior1st | r^2 =    0.102 | p-value =   3.9290e-02"
## [1] " ...  18 :           masvnrtype | r^2 =    0.668 | p-value =   0.0000e+00"
## [1] " ...  19 :           masvnrarea | r^2 =    0.001 | p-value =   1.5913e-01"
## [1] " ...  20 :            exterqual | r^2 =    0.344 | p-value =  1.1036e-135"
## [1] " ...  21 :            extercond | r^2 =    0.320 | p-value =  3.2115e-124"
## [1] " ...  22 :           foundation | r^2 =    0.043 | p-value =   2.0411e-01"
## [1] " ...  23 :             bsmtqual | r^2 =    0.018 | p-value =   9.2718e-01"
## [1] " ...  24 :         bsmtexposure | r^2 =    0.182 | p-value =   9.7516e-01"
## [1] " ...  25 :           bsmtfinsf1 | r^2 =    0.171 | p-value =   2.9103e-01"
## [1] " ...  26 :         bsmtfintype2 | r^2 =    0.193 | p-value =   1.0212e-03"
## [1] " ...  27 :            bsmtunfsf | r^2 =    0.183 | p-value =   2.1180e-65"
## [1] " ...  28 :          totalbsmtsf | r^2 =    0.461 | p-value =   2.7632e-56"
## [1] " ...  29 :              heating | r^2 =    0.046 | p-value =   5.1889e-03"
## [1] " ...  30 :            heatingqc | r^2 =    0.304 | p-value =   1.6345e-06"
## [1] " ...  31 :           electrical | r^2 =    0.435 | p-value =   2.4405e-65"
## [1] " ...  32 :            x1stflrsf | r^2 =    0.049 | p-value =   3.2754e-14"
## [1] " ...  33 :            x2ndflrsf | r^2 =    0.110 | p-value =   4.7398e-07"
## [1] " ...  34 :            grlivarea | r^2 =    0.198 | p-value =   2.2669e-02"
## [1] " ...  35 :         bsmtfullbath | r^2 =    0.153 | p-value =   2.1664e-54"
## [1] " ...  36 :             fullbath | r^2 =    0.007 | p-value =   1.3848e-02"
## [1] " ...  37 :             halfbath | r^2 =    0.002 | p-value =   1.1873e-01"
## [1] " ...  38 :         bedroomabvgr | r^2 =    0.049 | p-value =   9.3185e-18"
## [1] " ...  39 :          kitchenqual | r^2 =    0.413 | p-value =  6.2898e-171"
## [1] " ...  40 :         totrmsabvgrd | r^2 =    0.033 | p-value =   3.2858e-02"
## [1] " ...  41 :           functional | r^2 =    0.234 | p-value =   2.6901e-27"
## [1] " ...  42 :           fireplaces | r^2 =    0.124 | p-value =   9.8556e-44"
## [1] " ...  43 :          fireplacequ | r^2 =    0.097 | p-value =   1.4635e-01"
## [1] " ...  44 :           garagetype | r^2 =    0.383 | p-value =  5.3102e-155"
## [1] " ...  45 :          garageyrblt | r^2 =    0.102 | p-value =   5.8669e-36"
## [1] " ...  46 :           garagecars | r^2 =    0.004 | p-value =   1.1152e-02"
## [1] " ...  47 :           garagearea | r^2 =    0.517 | p-value =  7.3321e-232"
## [1] " ...  48 :           wooddecksf | r^2 =    0.056 | p-value =   5.7917e-20"
## [1] " ...  49 :          openporchsf | r^2 =    0.000 | p-value =   8.8755e-01"
## [1] " ...  50 :        enclosedporch | r^2 =    0.354 | p-value =  2.1190e-140"
## [1] " ...  51 :             saletype | r^2 =    0.099 | p-value =   9.1331e-35"
## [1] " ...  52 :        salecondition | r^2 =    0.044 | p-value =   5.3387e-16"
## [1] " ...  53 :        log_saleprice | r^2 =    0.021 | p-value =   2.0002e-08"
    df_sort <- df_fits[with(df_fits, order(-r_squared)), ]
    
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   do some feature reduction based on VIF
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        
    fit_all <- lm (log_saleprice ~ ., data = homes_subset)
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
    vif_lst <- vif(fit_all)
    vif_lst[order(vif_lst)]
##   [1] 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
##   [6] 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
##  [11] 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
##  [16] 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
##  [21] 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
##  [26] 1.108008e+00 1.111555e+00 1.146053e+00 1.155539e+00 1.156375e+00
##  [31] 1.157437e+00 1.161265e+00 1.168355e+00 1.175504e+00 1.183943e+00
##  [36] 1.208768e+00 1.217374e+00 1.226801e+00 1.249370e+00 1.296371e+00
##  [41] 1.310063e+00 1.316407e+00 1.324790e+00 1.336733e+00 1.339867e+00
##  [46] 1.359615e+00 1.383337e+00 1.385256e+00 1.401721e+00 1.447568e+00
##  [51] 1.456856e+00 1.461119e+00 1.475756e+00 1.481999e+00 1.527789e+00
##  [56] 1.528079e+00 1.543929e+00 1.619060e+00 1.625131e+00 1.633564e+00
##  [61] 1.704465e+00 1.726355e+00 1.730606e+00 1.732927e+00 1.811508e+00
##  [66] 1.828616e+00 1.946281e+00 2.000000e+00 2.177856e+00 2.239229e+00
##  [71] 2.330488e+00 2.334140e+00 2.335025e+00 2.351013e+00 2.367882e+00
##  [76] 2.391070e+00 2.657796e+00 2.658371e+00 2.705235e+00 2.845595e+00
##  [81] 2.905199e+00 2.945569e+00 2.976034e+00 2.980301e+00 2.994995e+00
##  [86] 3.000000e+00 3.000000e+00 3.000000e+00 3.000000e+00 3.000000e+00
##  [91] 3.219041e+00 3.226887e+00 3.343838e+00 3.604553e+00 3.788011e+00
##  [96] 3.803178e+00 4.000000e+00 4.000000e+00 4.000000e+00 4.000000e+00
## [101] 4.000000e+00 4.000000e+00 4.000000e+00 4.061432e+00 4.314933e+00
## [106] 4.459777e+00 4.739657e+00 5.000000e+00 5.000000e+00 5.000000e+00
## [111] 5.000000e+00 5.000000e+00 5.000000e+00 5.014146e+00 5.130894e+00
## [116] 5.160414e+00 5.516016e+00 5.527263e+00 5.667822e+00 5.675413e+00
## [121] 5.705150e+00 5.754807e+00 6.000000e+00 6.000000e+00 6.000000e+00
## [126] 7.000000e+00 7.063881e+00 7.066934e+00 7.318295e+00 8.000000e+00
## [131] 8.000000e+00 8.097409e+00 9.200958e+00 1.036223e+01 1.041280e+01
## [136] 1.299280e+01 1.354455e+01 1.355937e+01 1.400000e+01 1.649523e+01
## [141] 1.864728e+01 2.400000e+01 2.922576e+01 3.042643e+01 3.221031e+01
## [146] 3.311780e+01 4.306914e+01 4.865280e+01 9.252859e+01 9.397038e+01
## [151] 1.159637e+02 1.353202e+02 1.363498e+02 3.244560e+02 9.882801e+02
## [156] 2.576390e+05
    iter <- 1
    
    while ( vif_lst[order(-vif_lst[,1]),][1] > 5)
    {
        rmv_col <- order(-vif_lst[,1])[1]

                prnt_line <- paste(iter, "remove column :",
                       names(homes_subset)[[rmv_col]],
                        "VIF = ", round(vif_lst[order(-vif_lst[,1]),][1], 2))

        print (prnt_line)
   
        homes_subset[, rmv_col] = NULL
        
        fit_all <- lm (log_saleprice ~ .,
                        data = homes_subset)
        
        summary(fit_all)
        
        vif_lst <- vif(fit_all)
        vif_lst[order(vif_lst)]
    
        iter <- iter + 1
    }
## [1] "1 remove column : neighborhood VIF =  257639.01"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "2 remove column : bsmtqual VIF =  778.68"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "3 remove column : bsmtfintype2 VIF =  129.43"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "4 remove column : salecondition VIF =  117.98"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "5 remove column : housestyle VIF =  61.27"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "6 remove column : foundation VIF =  27.9"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "7 remove column : exterior1st VIF =  22.98"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "8 remove column : garagetype VIF =  14.84"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "9 remove column : totalbsmtsf VIF =  12.3"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "10 remove column : fireplacequ VIF =  12.08"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "11 remove column : x2ndflrsf VIF =  9.47"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "12 remove column : exterqual VIF =  8.06"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "13 remove column : yearbuilt VIF =  6.29"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "14 remove column : garagecars VIF =  6.05"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## [1] "15 remove column : grlivarea VIF =  5.39"
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
    cat ("\n-=-=-=-=-=   Colinearity reduced   -=-=-=-=-=-=\n")
## 
## -=-=-=-=-=   Colinearity reduced   -=-=-=-=-=-=
    names (homes_subset)
##  [1] "mszoning"      "lotfrontage"   "lotarea"       "lotshape"     
##  [5] "landcontour"   "lotconfig"     "landslope"     "condition1"   
##  [9] "bldgtype"      "overallqual"   "overallcond"   "yearremodadd" 
## [13] "roofstyle"     "masvnrtype"    "masvnrarea"    "extercond"    
## [17] "bsmtexposure"  "bsmtfinsf1"    "bsmtunfsf"     "heating"      
## [21] "heatingqc"     "electrical"    "x1stflrsf"     "bsmtfullbath" 
## [25] "fullbath"      "halfbath"      "bedroomabvgr"  "kitchenqual"  
## [29] "totrmsabvgrd"  "functional"    "fireplaces"    "garageyrblt"  
## [33] "garagearea"    "wooddecksf"    "openporchsf"   "enclosedporch"
## [37] "saletype"      "log_saleprice"
    plot(predict(fit_all) - homes_subset$log_saleprice)
    plot(predict(fit_all) ~ homes_subset$log_saleprice)
    plot(exp(predict(fit_all)) ~ exp(homes_subset$log_saleprice))

# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   test cases
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    
    setwd(data_dir)
    test_homes <- read.csv("test.csv", stringsAsFactors = FALSE)
    setwd(home_dir)
    
    names(test_homes) <- tolower(names(test_homes))
    
    for (i in 2:(length(test_homes)))
    {
        if (class(test_homes[,i]) == "character")
        {
            test_homes[,i] <- factor (test_homes[,i])
        }
    }

    plot(predict(fit_all, newdata = test_homes))
    
    test_homes$pred_log_saleprice <- predict(fit_all, newdata = test_homes)
    
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   submittal file
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    df_submit <- data.frame(test_homes$id, exp(test_homes$pred_log_saleprice))
    names(df_submit) <- c("Id", "SalePrice")
    
    df_submit$SalePrice[is.na(df_submit$SalePrice)] <- median(df_submit$SalePrice, na.rm = TRUE)

    write.csv(df_submit, file = "submit_test_pred.csv", row.names = FALSE)
    
    
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#  ...  Stepwise Regression - Forward
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

library (MASS)
    
    homes_subset <- homes_subset_base

    fit_forward <- lm (log_saleprice ~ ., data = homes_subset)
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
    step <- stepAIC(fit_forward, direction = "forward")
## Start:  AIC=-6362.59
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + roofstyle + exterior1st + masvnrtype + masvnrarea + 
##     exterqual + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + electrical + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + fireplacequ + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
    step$anova # display results 
## Stepwise Model Path 
## Analysis of Deviance Table
## 
## Initial Model:
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + roofstyle + exterior1st + masvnrtype + masvnrarea + 
##     exterqual + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + electrical + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + fireplacequ + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## 
## Final Model:
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + roofstyle + exterior1st + masvnrtype + masvnrarea + 
##     exterqual + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + electrical + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + fireplacequ + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## 
## 
##   Step Df Deviance Resid. Df Resid. Dev       AIC
## 1                       1280   14.60957 -6362.592
    plot(predict(fit_forward, newdata = test_homes))
    
    test_homes$pred_fwd_log_saleprice <- predict(fit_forward, newdata = test_homes)
    
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   submittal file - forward selection
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    df_submit_fwd <- data.frame(test_homes$id, exp(test_homes$pred_fwd_log_saleprice))
    names(df_submit_fwd) <- c("Id", "SalePrice")
    
    df_submit_fwd$SalePrice[is.na(df_submit_fwd$SalePrice)] <- median(df_submit_fwd$SalePrice, na.rm = TRUE)

    write.csv(df_submit_fwd, file = "submit_test_pred_fwd_selection.csv", row.names = FALSE)

# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#  ...  Stepwise Regression - Backward
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    
    homes_subset <- homes_subset_base

    fit_backward <- lm (log_saleprice ~ ., data = homes_subset)
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
    step <- stepAIC(fit_backward, direction = "backward")
## Start:  AIC=-6362.59
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + roofstyle + exterior1st + masvnrtype + masvnrarea + 
##     exterqual + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + electrical + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + fireplacequ + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - roofstyle      5   0.01645 14.626 -6370.9
## - bsmtfintype2   6   0.05027 14.660 -6369.6
## - fireplacequ    5   0.04562 14.655 -6368.0
## - exterqual      3   0.00588 14.615 -6368.0
## - electrical     5   0.04715 14.657 -6367.9
## - housestyle     7   0.10490 14.714 -6366.1
## - landslope      2   0.01312 14.623 -6365.3
## - lotshape       3   0.03659 14.646 -6364.9
## - bsmtfinsf1     1   0.00183 14.611 -6364.4
## - garageyrblt    1   0.00234 14.612 -6364.4
## - totrmsabvgrd   1   0.00582 14.615 -6364.0
## - bedroomabvgr   1   0.00660 14.616 -6363.9
## - bsmtqual       4   0.06700 14.677 -6363.9
## - fireplaces     1   0.01648 14.626 -6362.9
## - fullbath       1   0.01654 14.626 -6362.9
## <none>                       14.610 -6362.6
## - lotfrontage    1   0.02008 14.630 -6362.6
## - masvnrtype     3   0.06174 14.671 -6362.4
## - garagetype     6   0.12248 14.732 -6362.4
## - landcontour    3   0.06903 14.679 -6361.7
## - bsmtunfsf      1   0.03090 14.640 -6361.5
## - halfbath       1   0.04138 14.651 -6360.5
## - masvnrarea     1   0.04142 14.651 -6360.5
## - lotconfig      4   0.10313 14.713 -6360.3
## - enclosedporch  1   0.04712 14.657 -6359.9
## - garagearea     1   0.04860 14.658 -6359.7
## - extercond      4   0.10917 14.719 -6359.7
## - bsmtexposure   4   0.12554 14.735 -6358.1
## - openporchsf    1   0.06809 14.678 -6357.8
## - garagecars     1   0.07322 14.683 -6357.3
## - wooddecksf     1   0.08512 14.695 -6356.1
## - yearremodadd   1   0.08748 14.697 -6355.9
## - saletype       8   0.23491 14.845 -6355.3
## - bsmtfullbath   1   0.09528 14.705 -6355.1
## - heatingqc      4   0.16236 14.772 -6354.5
## - foundation     5   0.19201 14.802 -6353.5
## - heating        5   0.21065 14.820 -6351.7
## - totalbsmtsf    1   0.16727 14.777 -6348.0
## - lotarea        1   0.17002 14.780 -6347.7
## - kitchenqual    3   0.21834 14.828 -6346.9
## - exterior1st   14   0.46908 15.079 -6344.5
## - bldgtype       4   0.31815 14.928 -6339.1
## - salecondition  5   0.40092 15.011 -6333.1
## - condition1     8   0.51826 15.128 -6327.7
## - grlivarea      1   0.39887 15.008 -6325.3
## - yearbuilt      1   0.43911 15.049 -6321.4
## - x2ndflrsf      1   0.48112 15.091 -6317.3
## - functional     6   0.88339 15.493 -6288.9
## - x1stflrsf      1   0.78642 15.396 -6288.0
## - neighborhood  24   1.44487 16.054 -6272.9
## - mszoning       4   1.07153 15.681 -6267.3
## - overallqual    1   1.08079 15.690 -6260.4
## - overallcond    1   1.43865 16.048 -6227.5
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6370.95
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + exterqual + 
##     extercond + foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + 
##     bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + heatingqc + 
##     electrical + x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + 
##     fullbath + halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + 
##     functional + fireplaces + fireplacequ + garagetype + garageyrblt + 
##     garagecars + garagearea + wooddecksf + openporchsf + enclosedporch + 
##     saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - bsmtfintype2   6   0.05146 14.678 -6377.8
## - exterqual      3   0.00505 14.631 -6376.4
## - electrical     5   0.04736 14.673 -6376.2
## - fireplacequ    5   0.04972 14.676 -6376.0
## - housestyle     7   0.10560 14.732 -6374.4
## - landslope      2   0.01264 14.639 -6373.7
## - lotshape       3   0.03548 14.662 -6373.4
## - bsmtfinsf1     1   0.00154 14.628 -6372.8
## - garageyrblt    1   0.00306 14.629 -6372.6
## - bsmtqual       4   0.06691 14.693 -6372.3
## - totrmsabvgrd   1   0.00689 14.633 -6372.3
## - bedroomabvgr   1   0.00729 14.633 -6372.2
## - fireplaces     1   0.01601 14.642 -6371.4
## - fullbath       1   0.01720 14.643 -6371.2
## <none>                       14.626 -6370.9
## - garagetype     6   0.12166 14.748 -6370.9
## - masvnrtype     3   0.06160 14.688 -6370.8
## - lotfrontage    1   0.02233 14.648 -6370.7
## - landcontour    3   0.07131 14.697 -6369.8
## - bsmtunfsf      1   0.03334 14.659 -6369.6
## - masvnrarea     1   0.04083 14.667 -6368.9
## - enclosedporch  1   0.04385 14.670 -6368.6
## - extercond      4   0.10674 14.733 -6368.3
## - halfbath       1   0.04807 14.674 -6368.2
## - garagearea     1   0.04856 14.675 -6368.1
## - lotconfig      4   0.10991 14.736 -6368.0
## - openporchsf    1   0.06747 14.694 -6366.2
## - bsmtexposure   4   0.13064 14.757 -6366.0
## - garagecars     1   0.07439 14.700 -6365.5
## - yearremodadd   1   0.08600 14.712 -6364.4
## - wooddecksf     1   0.08796 14.714 -6364.2
## - saletype       8   0.23286 14.859 -6363.9
## - bsmtfullbath   1   0.09219 14.718 -6363.8
## - heatingqc      4   0.16800 14.794 -6362.3
## - foundation     5   0.20176 14.828 -6360.9
## - heating        5   0.21186 14.838 -6360.0
## - totalbsmtsf    1   0.16935 14.795 -6356.1
## - kitchenqual    3   0.22056 14.847 -6355.1
## - lotarea        1   0.18102 14.807 -6355.0
## - exterior1st   14   0.46782 15.094 -6353.0
## - bldgtype       4   0.31574 14.942 -6347.8
## - salecondition  5   0.40186 15.028 -6341.4
## - condition1     8   0.51807 15.144 -6336.1
## - grlivarea      1   0.40495 15.031 -6333.1
## - yearbuilt      1   0.43191 15.058 -6330.5
## - x2ndflrsf      1   0.48415 15.110 -6325.4
## - functional     6   0.88671 15.513 -6297.0
## - x1stflrsf      1   0.79072 15.417 -6296.1
## - neighborhood  24   1.43844 16.064 -6282.0
## - mszoning       4   1.09579 15.722 -6273.5
## - overallqual    1   1.10357 15.730 -6266.7
## - overallcond    1   1.43725 16.063 -6236.1
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6377.82
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + exterqual + 
##     extercond + foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + electrical + 
##     x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + fullbath + 
##     halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + fireplacequ + garagetype + garageyrblt + garagecars + 
##     garagearea + wooddecksf + openporchsf + enclosedporch + saletype + 
##     salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - fireplacequ    5   0.04460 14.722 -6383.4
## - exterqual      3   0.00545 14.683 -6383.3
## - electrical     5   0.04661 14.724 -6383.2
## - housestyle     7   0.09786 14.775 -6382.1
## - landslope      2   0.01153 14.689 -6380.7
## - lotshape       3   0.03508 14.713 -6380.3
## - bsmtqual       4   0.06020 14.738 -6379.8
## - garageyrblt    1   0.00255 14.680 -6379.6
## - bedroomabvgr   1   0.00565 14.683 -6379.3
## - totrmsabvgrd   1   0.00648 14.684 -6379.2
## - fireplaces     1   0.01438 14.692 -6378.4
## - fullbath       1   0.01731 14.695 -6378.1
## <none>                       14.678 -6377.8
## - masvnrtype     3   0.06227 14.740 -6377.6
## - lotfrontage    1   0.02227 14.700 -6377.6
## - garagetype     6   0.12821 14.806 -6377.1
## - landcontour    3   0.07025 14.748 -6376.9
## - bsmtfinsf1     1   0.03206 14.710 -6376.6
## - masvnrarea     1   0.03875 14.716 -6376.0
## - bsmtunfsf      1   0.04084 14.718 -6375.8
## - garagearea     1   0.04278 14.720 -6375.6
## - enclosedporch  1   0.04413 14.722 -6375.4
## - extercond      4   0.10814 14.786 -6375.1
## - lotconfig      4   0.11089 14.788 -6374.8
## - halfbath       1   0.05049 14.728 -6374.8
## - openporchsf    1   0.06973 14.747 -6372.9
## - garagecars     1   0.07866 14.756 -6372.0
## - bsmtexposure   4   0.14580 14.823 -6371.4
## - wooddecksf     1   0.08544 14.763 -6371.3
## - yearremodadd   1   0.08552 14.763 -6371.3
## - bsmtfullbath   1   0.09132 14.769 -6370.8
## - saletype       8   0.24582 14.923 -6369.6
## - heatingqc      4   0.17009 14.848 -6369.0
## - foundation     5   0.20106 14.879 -6368.0
## - heating        5   0.21408 14.892 -6366.7
## - kitchenqual    3   0.22352 14.901 -6361.8
## - lotarea        1   0.19258 14.870 -6360.8
## - exterior1st   14   0.48778 15.165 -6358.1
## - bldgtype       4   0.30810 14.986 -6355.5
## - totalbsmtsf    1   0.27611 14.954 -6352.6
## - salecondition  5   0.40995 15.087 -6347.6
## - condition1     8   0.52066 15.198 -6342.9
## - grlivarea      1   0.41059 15.088 -6339.5
## - yearbuilt      1   0.44866 15.126 -6335.9
## - x2ndflrsf      1   0.48292 15.160 -6332.6
## - functional     6   0.88025 15.558 -6304.8
## - x1stflrsf      1   0.82248 15.500 -6300.2
## - neighborhood  24   1.45880 16.136 -6287.5
## - mszoning       4   1.10117 15.779 -6280.2
## - overallqual    1   1.11991 15.797 -6272.5
## - overallcond    1   1.44117 16.119 -6243.1
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6383.39
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + exterqual + 
##     extercond + foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + electrical + 
##     x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + fullbath + 
##     halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + garagetype + garageyrblt + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - exterqual      3   0.00457 14.727 -6388.9
## - electrical     5   0.04584 14.768 -6388.9
## - housestyle     7   0.09841 14.820 -6387.7
## - landslope      2   0.01197 14.734 -6386.2
## - lotshape       3   0.03259 14.755 -6386.2
## - garageyrblt    1   0.00264 14.725 -6385.1
## - totrmsabvgrd   1   0.00409 14.726 -6385.0
## - bsmtqual       4   0.06541 14.787 -6384.9
## - bedroomabvgr   1   0.00574 14.728 -6384.8
## - fullbath       1   0.01409 14.736 -6384.0
## <none>                       14.722 -6383.4
## - masvnrtype     3   0.06383 14.786 -6383.1
## - lotfrontage    1   0.02564 14.748 -6382.9
## - garagetype     6   0.13024 14.852 -6382.5
## - landcontour    3   0.06961 14.792 -6382.5
## - bsmtfinsf1     1   0.02989 14.752 -6382.4
## - masvnrarea     1   0.03697 14.759 -6381.7
## - enclosedporch  1   0.03904 14.761 -6381.5
## - bsmtunfsf      1   0.04016 14.762 -6381.4
## - garagearea     1   0.04373 14.766 -6381.1
## - lotconfig      4   0.10812 14.830 -6380.7
## - halfbath       1   0.05032 14.772 -6380.4
## - extercond      4   0.11265 14.835 -6380.3
## - openporchsf    1   0.06680 14.789 -6378.8
## - garagecars     1   0.07934 14.801 -6377.5
## - yearremodadd   1   0.08318 14.805 -6377.2
## - bsmtexposure   4   0.14665 14.869 -6376.9
## - bsmtfullbath   1   0.08729 14.809 -6376.8
## - wooddecksf     1   0.08759 14.810 -6376.7
## - saletype       8   0.24887 14.971 -6374.9
## - heatingqc      4   0.17114 14.893 -6374.5
## - foundation     5   0.20124 14.923 -6373.6
## - heating        5   0.21033 14.932 -6372.7
## - fireplaces     1   0.16227 14.884 -6369.4
## - kitchenqual    3   0.22400 14.946 -6367.3
## - lotarea        1   0.19299 14.915 -6366.4
## - exterior1st   14   0.49262 15.215 -6363.3
## - bldgtype       4   0.30988 15.032 -6361.0
## - totalbsmtsf    1   0.27719 14.999 -6358.2
## - salecondition  5   0.41703 15.139 -6352.6
## - condition1     8   0.51772 15.240 -6348.9
## - grlivarea      1   0.42903 15.151 -6343.5
## - yearbuilt      1   0.43901 15.161 -6342.5
## - x2ndflrsf      1   0.47495 15.197 -6339.0
## - functional     6   0.87515 15.597 -6311.1
## - x1stflrsf      1   0.79983 15.522 -6308.2
## - neighborhood  24   1.48529 16.207 -6291.1
## - mszoning       4   1.10269 15.825 -6285.9
## - overallqual    1   1.12705 15.849 -6277.7
## - overallcond    1   1.43263 16.155 -6249.8
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6388.94
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + extercond + 
##     foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + bsmtunfsf + 
##     totalbsmtsf + heating + heatingqc + electrical + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + garagetype + garageyrblt + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - electrical     5   0.04610 14.773 -6394.4
## - housestyle     7   0.09936 14.826 -6393.1
## - lotshape       3   0.03233 14.759 -6391.7
## - landslope      2   0.01236 14.739 -6391.7
## - garageyrblt    1   0.00244 14.729 -6390.7
## - totrmsabvgrd   1   0.00417 14.731 -6390.5
## - bsmtqual       4   0.06557 14.792 -6390.5
## - bedroomabvgr   1   0.00608 14.733 -6390.3
## - fullbath       1   0.01404 14.741 -6389.5
## <none>                       14.727 -6388.9
## - masvnrtype     3   0.06270 14.789 -6388.7
## - lotfrontage    1   0.02570 14.752 -6388.4
## - landcontour    3   0.06844 14.795 -6388.2
## - garagetype     6   0.13020 14.857 -6388.1
## - bsmtfinsf1     1   0.03010 14.757 -6388.0
## - masvnrarea     1   0.03774 14.764 -6387.2
## - enclosedporch  1   0.03942 14.766 -6387.0
## - bsmtunfsf      1   0.04075 14.767 -6386.9
## - garagearea     1   0.04332 14.770 -6386.6
## - lotconfig      4   0.10830 14.835 -6386.2
## - halfbath       1   0.05004 14.777 -6386.0
## - extercond      4   0.11438 14.841 -6385.6
## - openporchsf    1   0.06696 14.794 -6384.3
## - garagecars     1   0.07981 14.806 -6383.0
## - yearremodadd   1   0.08292 14.810 -6382.7
## - bsmtfullbath   1   0.08638 14.813 -6382.4
## - bsmtexposure   4   0.14843 14.875 -6382.3
## - wooddecksf     1   0.08910 14.816 -6382.1
## - saletype       8   0.25017 14.977 -6380.3
## - heatingqc      4   0.16839 14.895 -6380.3
## - foundation     5   0.19913 14.926 -6379.3
## - heating        5   0.20999 14.937 -6378.3
## - fireplaces     1   0.16181 14.889 -6375.0
## - lotarea        1   0.19192 14.919 -6372.0
## - kitchenqual    3   0.23866 14.965 -6371.5
## - exterior1st   14   0.49231 15.219 -6368.9
## - bldgtype       4   0.31248 15.039 -6366.3
## - totalbsmtsf    1   0.27590 15.002 -6363.8
## - salecondition  5   0.41532 15.142 -6358.3
## - condition1     8   0.51726 15.244 -6354.5
## - grlivarea      1   0.43154 15.158 -6348.8
## - yearbuilt      1   0.43822 15.165 -6348.1
## - x2ndflrsf      1   0.47558 15.202 -6344.5
## - functional     6   0.88982 15.617 -6315.3
## - x1stflrsf      1   0.80825 15.535 -6312.9
## - neighborhood  24   1.48855 16.215 -6296.4
## - mszoning       4   1.12345 15.850 -6289.6
## - overallqual    1   1.14004 15.867 -6282.1
## - overallcond    1   1.43710 16.164 -6255.0
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6394.38
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + extercond + 
##     foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + bsmtunfsf + 
##     totalbsmtsf + heating + heatingqc + x1stflrsf + x2ndflrsf + 
##     grlivarea + bsmtfullbath + fullbath + halfbath + bedroomabvgr + 
##     kitchenqual + totrmsabvgrd + functional + fireplaces + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - housestyle     7   0.10384 14.877 -6398.1
## - lotshape       3   0.02869 14.801 -6397.5
## - landslope      2   0.01336 14.786 -6397.1
## - totrmsabvgrd   1   0.00300 14.776 -6396.1
## - garageyrblt    1   0.00307 14.776 -6396.1
## - bsmtqual       4   0.06573 14.838 -6395.9
## - bedroomabvgr   1   0.00554 14.778 -6395.8
## - fullbath       1   0.01283 14.786 -6395.1
## <none>                       14.773 -6394.4
## - masvnrtype     3   0.06098 14.834 -6394.4
## - garagetype     6   0.12472 14.898 -6394.1
## - lotfrontage    1   0.02586 14.799 -6393.8
## - bsmtfinsf1     1   0.03074 14.803 -6393.3
## - landcontour    3   0.07451 14.847 -6393.0
## - enclosedporch  1   0.03493 14.808 -6392.9
## - masvnrarea     1   0.03684 14.810 -6392.7
## - garagearea     1   0.04023 14.813 -6392.4
## - bsmtunfsf      1   0.04041 14.813 -6392.4
## - lotconfig      4   0.11061 14.883 -6391.5
## - halfbath       1   0.05010 14.823 -6391.4
## - extercond      4   0.11736 14.890 -6390.8
## - openporchsf    1   0.06832 14.841 -6389.6
## - garagecars     1   0.08154 14.854 -6388.3
## - yearremodadd   1   0.08280 14.855 -6388.2
## - bsmtfullbath   1   0.08353 14.856 -6388.1
## - wooddecksf     1   0.08787 14.861 -6387.7
## - bsmtexposure   4   0.14948 14.922 -6387.7
## - saletype       8   0.24881 15.022 -6386.0
## - foundation     5   0.18762 14.960 -6386.0
## - heatingqc      4   0.16793 14.941 -6385.9
## - heating        5   0.20527 14.978 -6384.2
## - fireplaces     1   0.15878 14.931 -6380.8
## - lotarea        1   0.19532 14.968 -6377.2
## - kitchenqual    3   0.24361 15.016 -6376.5
## - exterior1st   14   0.52092 15.294 -6371.8
## - bldgtype       4   0.32153 15.094 -6370.9
## - totalbsmtsf    1   0.27124 15.044 -6369.8
## - salecondition  5   0.39684 15.170 -6365.7
## - condition1     8   0.51513 15.288 -6360.3
## - grlivarea      1   0.42885 15.202 -6354.6
## - yearbuilt      1   0.43047 15.203 -6354.4
## - x2ndflrsf      1   0.48553 15.258 -6349.2
## - functional     6   0.89170 15.664 -6320.8
## - x1stflrsf      1   0.81438 15.587 -6318.0
## - neighborhood  24   1.50263 16.275 -6300.9
## - mszoning       4   1.13368 15.906 -6294.4
## - overallqual    1   1.13215 15.905 -6288.6
## - overallcond    1   1.42951 16.202 -6261.5
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6398.15
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + overallqual + overallcond + yearbuilt + yearremodadd + 
##     exterior1st + masvnrtype + masvnrarea + extercond + foundation + 
##     bsmtqual + bsmtexposure + bsmtfinsf1 + bsmtunfsf + totalbsmtsf + 
##     heating + heatingqc + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + garagetype + garageyrblt + 
##     garagecars + garagearea + wooddecksf + openporchsf + enclosedporch + 
##     saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - lotshape       3   0.02576 14.902 -6401.6
## - landslope      2   0.00924 14.886 -6401.2
## - totrmsabvgrd   1   0.00213 14.879 -6399.9
## - bsmtqual       4   0.06378 14.940 -6399.9
## - bedroomabvgr   1   0.00261 14.879 -6399.9
## - garageyrblt    1   0.00399 14.881 -6399.8
## - fullbath       1   0.01386 14.890 -6398.8
## - masvnrtype     3   0.05613 14.933 -6398.7
## <none>                       14.877 -6398.1
## - landcontour    3   0.06316 14.940 -6398.0
## - lotfrontage    1   0.02310 14.900 -6397.9
## - garagetype     6   0.12737 15.004 -6397.7
## - bsmtfinsf1     1   0.03042 14.907 -6397.2
## - masvnrarea     1   0.03779 14.914 -6396.4
## - enclosedporch  1   0.03780 14.914 -6396.4
## - garagearea     1   0.03903 14.916 -6396.3
## - bsmtunfsf      1   0.03996 14.916 -6396.2
## - halfbath       1   0.04285 14.919 -6395.9
## - lotconfig      4   0.11198 14.989 -6395.2
## - extercond      4   0.11928 14.996 -6394.5
## - openporchsf    1   0.05912 14.936 -6394.4
## - yearremodadd   1   0.06941 14.946 -6393.4
## - garagecars     1   0.07590 14.953 -6392.7
## - foundation     5   0.16631 15.043 -6391.9
## - wooddecksf     1   0.08487 14.961 -6391.8
## - bsmtfullbath   1   0.08518 14.962 -6391.8
## - heatingqc      4   0.17517 15.052 -6389.1
## - saletype       8   0.26149 15.138 -6388.7
## - bsmtexposure   4   0.18013 15.057 -6388.6
## - heating        5   0.20963 15.086 -6387.7
## - fireplaces     1   0.16921 15.046 -6383.6
## - lotarea        1   0.18485 15.061 -6382.1
## - kitchenqual    3   0.24218 15.119 -6380.6
## - exterior1st   14   0.51906 15.396 -6376.1
## - totalbsmtsf    1   0.25365 15.130 -6375.5
## - bldgtype       4   0.33179 15.208 -6373.9
## - salecondition  5   0.41027 15.287 -6368.4
## - condition1     8   0.49403 15.371 -6366.5
## - yearbuilt      1   0.42444 15.301 -6359.1
## - grlivarea      1   0.47423 15.351 -6354.3
## - x2ndflrsf      1   0.66315 15.540 -6336.5
## - functional     6   0.90371 15.780 -6324.0
## - x1stflrsf      1   0.90811 15.785 -6313.6
## - neighborhood  24   1.51257 16.389 -6304.8
## - mszoning       4   1.13615 16.013 -6298.7
## - overallqual    1   1.22371 16.100 -6284.7
## - overallcond    1   1.45216 16.329 -6264.2
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6401.62
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + landslope + neighborhood + condition1 + bldgtype + 
##     overallqual + overallcond + yearbuilt + yearremodadd + exterior1st + 
##     masvnrtype + masvnrarea + extercond + foundation + bsmtqual + 
##     bsmtexposure + bsmtfinsf1 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + 
##     fullbath + halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + 
##     functional + fireplaces + garagetype + garageyrblt + garagecars + 
##     garagearea + wooddecksf + openporchsf + enclosedporch + saletype + 
##     salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - landslope      2   0.00988 14.912 -6404.7
## - totrmsabvgrd   1   0.00240 14.905 -6403.4
## - bsmtqual       4   0.06388 14.966 -6403.4
## - bedroomabvgr   1   0.00291 14.905 -6403.3
## - garageyrblt    1   0.00428 14.907 -6403.2
## - masvnrtype     3   0.05244 14.955 -6402.5
## - fullbath       1   0.01465 14.917 -6402.2
## <none>                       14.902 -6401.6
## - lotfrontage    1   0.02124 14.924 -6401.5
## - landcontour    3   0.06268 14.965 -6401.5
## - garagetype     6   0.12786 15.030 -6401.1
## - bsmtfinsf1     1   0.02741 14.930 -6400.9
## - enclosedporch  1   0.03584 14.938 -6400.1
## - masvnrarea     1   0.03646 14.939 -6400.1
## - garagearea     1   0.03778 14.940 -6399.9
## - halfbath       1   0.04172 14.944 -6399.5
## - bsmtunfsf      1   0.04490 14.947 -6399.2
## - extercond      4   0.11880 15.021 -6398.0
## - openporchsf    1   0.06197 14.964 -6397.6
## - lotconfig      4   0.12639 15.029 -6397.3
## - yearremodadd   1   0.07232 14.975 -6396.6
## - foundation     5   0.15922 15.062 -6396.1
## - garagecars     1   0.07752 14.980 -6396.0
## - bsmtfullbath   1   0.08089 14.983 -6395.7
## - wooddecksf     1   0.08332 14.986 -6395.5
## - heatingqc      4   0.17484 15.077 -6392.6
## - bsmtexposure   4   0.18068 15.083 -6392.0
## - saletype       8   0.26570 15.168 -6391.8
## - heating        5   0.20899 15.111 -6391.3
## - fireplaces     1   0.17012 15.072 -6387.1
## - kitchenqual    3   0.24794 15.150 -6383.5
## - lotarea        1   0.22261 15.125 -6382.0
## - exterior1st   14   0.52327 15.426 -6379.2
## - totalbsmtsf    1   0.25871 15.161 -6378.5
## - bldgtype       4   0.32965 15.232 -6377.7
## - salecondition  5   0.40936 15.312 -6372.1
## - condition1     8   0.49078 15.393 -6370.3
## - yearbuilt      1   0.42906 15.331 -6362.2
## - grlivarea      1   0.48210 15.384 -6357.1
## - x2ndflrsf      1   0.65629 15.559 -6340.7
## - functional     6   0.91933 15.822 -6326.2
## - x1stflrsf      1   0.90879 15.811 -6317.2
## - neighborhood  24   1.52488 16.427 -6307.4
## - mszoning       4   1.13952 16.042 -6302.0
## - overallqual    1   1.22798 16.130 -6288.0
## - overallcond    1   1.46436 16.367 -6266.8
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6404.66
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtunfsf + totalbsmtsf + heating + heatingqc + 
##     x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + fullbath + 
##     halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + garagetype + garageyrblt + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - bsmtqual       4   0.06368 14.976 -6406.4
## - bedroomabvgr   1   0.00322 14.915 -6406.3
## - totrmsabvgrd   1   0.00338 14.916 -6406.3
## - garageyrblt    1   0.00460 14.917 -6406.2
## - masvnrtype     3   0.05213 14.964 -6405.6
## - fullbath       1   0.01633 14.929 -6405.1
## - landcontour    3   0.05938 14.972 -6404.9
## <none>                       14.912 -6404.7
## - lotfrontage    1   0.02052 14.933 -6404.6
## - garagetype     6   0.12461 15.037 -6404.5
## - bsmtfinsf1     1   0.02739 14.940 -6404.0
## - masvnrarea     1   0.03437 14.947 -6403.3
## - enclosedporch  1   0.03574 14.948 -6403.2
## - garagearea     1   0.03592 14.948 -6403.1
## - halfbath       1   0.04380 14.956 -6402.4
## - bsmtunfsf      1   0.04602 14.958 -6402.2
## - extercond      4   0.12218 15.034 -6400.7
## - openporchsf    1   0.06242 14.975 -6400.6
## - lotconfig      4   0.12629 15.039 -6400.3
## - yearremodadd   1   0.07097 14.983 -6399.7
## - foundation     5   0.15942 15.072 -6399.1
## - garagecars     1   0.07829 14.991 -6399.0
## - bsmtfullbath   1   0.08123 14.993 -6398.7
## - wooddecksf     1   0.08584 14.998 -6398.3
## - heatingqc      4   0.17554 15.088 -6395.6
## - saletype       8   0.26203 15.174 -6395.2
## - heating        5   0.20606 15.118 -6394.6
## - bsmtexposure   4   0.20027 15.113 -6393.2
## - fireplaces     1   0.17190 15.084 -6389.9
## - kitchenqual    3   0.24598 15.158 -6386.8
## - lotarea        1   0.22563 15.138 -6384.7
## - exterior1st   14   0.52759 15.440 -6381.9
## - totalbsmtsf    1   0.25609 15.168 -6381.8
## - bldgtype       4   0.34234 15.255 -6379.5
## - salecondition  5   0.40956 15.322 -6375.1
## - condition1     8   0.48910 15.401 -6373.5
## - yearbuilt      1   0.43065 15.343 -6365.1
## - grlivarea      1   0.49168 15.404 -6359.3
## - x2ndflrsf      1   0.65754 15.570 -6343.7
## - functional     6   0.91600 15.828 -6329.6
## - x1stflrsf      1   0.92276 15.835 -6319.0
## - neighborhood  24   1.54128 16.453 -6309.1
## - mszoning       4   1.13448 16.047 -6305.6
## - overallqual    1   1.21910 16.131 -6291.9
## - overallcond    1   1.47102 16.383 -6269.3
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6406.43
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + garagetype + garageyrblt + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - bedroomabvgr   1   0.00076 14.977 -6408.4
## - totrmsabvgrd   1   0.00290 14.979 -6408.2
## - garageyrblt    1   0.00564 14.982 -6407.9
## - masvnrtype     3   0.05500 15.031 -6407.1
## - landcontour    3   0.05853 15.034 -6406.7
## - fullbath       1   0.01795 14.994 -6406.7
## <none>                       14.976 -6406.4
## - garagetype     6   0.12776 15.104 -6406.0
## - lotfrontage    1   0.02538 15.001 -6406.0
## - masvnrarea     1   0.03041 15.006 -6405.5
## - bsmtfinsf1     1   0.03246 15.008 -6405.3
## - garagearea     1   0.03473 15.011 -6405.1
## - enclosedporch  1   0.03705 15.013 -6404.8
## - halfbath       1   0.04360 15.020 -6404.2
## - bsmtunfsf      1   0.04365 15.020 -6404.2
## - extercond      4   0.12058 15.097 -6402.7
## - lotconfig      4   0.13123 15.107 -6401.7
## - openporchsf    1   0.07044 15.046 -6401.6
## - yearremodadd   1   0.07345 15.049 -6401.3
## - foundation     5   0.15770 15.134 -6401.1
## - bsmtfullbath   1   0.08324 15.059 -6400.3
## - garagecars     1   0.08588 15.062 -6400.1
## - wooddecksf     1   0.09392 15.070 -6399.3
## - heatingqc      4   0.17653 15.152 -6397.3
## - saletype       8   0.26482 15.241 -6396.8
## - heating        5   0.20576 15.182 -6396.5
## - bsmtexposure   4   0.21843 15.194 -6393.3
## - fireplaces     1   0.16265 15.139 -6392.7
## - lotarea        1   0.21787 15.194 -6387.3
## - totalbsmtsf    1   0.25382 15.230 -6383.9
## - exterior1st   14   0.53020 15.506 -6383.6
## - kitchenqual    3   0.30782 15.284 -6382.7
## - bldgtype       4   0.35536 15.331 -6380.2
## - salecondition  5   0.41843 15.394 -6376.2
## - condition1     8   0.49839 15.474 -6374.6
## - grlivarea      1   0.47694 15.453 -6362.7
## - yearbuilt      1   0.50305 15.479 -6360.2
## - x2ndflrsf      1   0.69657 15.672 -6342.1
## - functional     6   0.91229 15.888 -6332.1
## - x1stflrsf      1   0.97633 15.952 -6316.2
## - neighborhood  24   1.56467 16.541 -6309.3
## - mszoning       4   1.12883 16.105 -6308.3
## - overallqual    1   1.31110 16.287 -6285.9
## - overallcond    1   1.45436 16.430 -6273.1
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6408.36
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     kitchenqual + totrmsabvgrd + functional + fireplaces + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - totrmsabvgrd   1   0.00221 14.979 -6410.1
## - garageyrblt    1   0.00553 14.982 -6409.8
## - masvnrtype     3   0.05513 15.032 -6409.0
## - landcontour    3   0.05833 15.035 -6408.7
## - fullbath       1   0.01912 14.996 -6408.5
## <none>                       14.977 -6408.4
## - garagetype     6   0.12706 15.104 -6408.0
## - lotfrontage    1   0.02549 15.002 -6407.9
## - masvnrarea     1   0.03054 15.007 -6407.4
## - bsmtfinsf1     1   0.03217 15.009 -6407.2
## - garagearea     1   0.03414 15.011 -6407.0
## - enclosedporch  1   0.03784 15.014 -6406.7
## - halfbath       1   0.04333 15.020 -6406.1
## - bsmtunfsf      1   0.04355 15.020 -6406.1
## - extercond      4   0.11985 15.097 -6404.7
## - lotconfig      4   0.13065 15.107 -6403.7
## - openporchsf    1   0.07001 15.047 -6403.6
## - yearremodadd   1   0.07272 15.049 -6403.3
## - foundation     5   0.15819 15.135 -6403.0
## - bsmtfullbath   1   0.08307 15.060 -6402.3
## - garagecars     1   0.08641 15.063 -6402.0
## - wooddecksf     1   0.09387 15.070 -6401.2
## - heatingqc      4   0.17587 15.152 -6399.3
## - saletype       8   0.26462 15.241 -6398.8
## - heating        5   0.20775 15.184 -6398.2
## - bsmtexposure   4   0.21772 15.194 -6395.3
## - fireplaces     1   0.16190 15.139 -6394.7
## - lotarea        1   0.21769 15.194 -6389.3
## - totalbsmtsf    1   0.25379 15.230 -6385.8
## - exterior1st   14   0.52957 15.506 -6385.6
## - kitchenqual    3   0.30751 15.284 -6384.7
## - bldgtype       4   0.35838 15.335 -6381.8
## - salecondition  5   0.41953 15.396 -6378.0
## - condition1     8   0.49766 15.474 -6376.6
## - grlivarea      1   0.47745 15.454 -6364.5
## - yearbuilt      1   0.50679 15.483 -6361.8
## - x2ndflrsf      1   0.70913 15.686 -6342.8
## - functional     6   0.91451 15.891 -6333.8
## - x1stflrsf      1   0.98030 15.957 -6317.8
## - neighborhood  24   1.57177 16.548 -6310.7
## - mszoning       4   1.13124 16.108 -6310.0
## - overallqual    1   1.31273 16.289 -6287.7
## - overallcond    1   1.46005 16.437 -6274.5
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6410.14
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     kitchenqual + functional + fireplaces + garagetype + garageyrblt + 
##     garagecars + garagearea + wooddecksf + openporchsf + enclosedporch + 
##     saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - garageyrblt    1   0.00540 14.984 -6411.6
## - masvnrtype     3   0.05379 15.033 -6410.9
## - fullbath       1   0.01793 14.997 -6410.4
## - landcontour    3   0.06028 15.039 -6410.3
## <none>                       14.979 -6410.1
## - garagetype     6   0.12652 15.105 -6409.9
## - lotfrontage    1   0.02527 15.004 -6409.7
## - masvnrarea     1   0.03077 15.010 -6409.1
## - bsmtfinsf1     1   0.03263 15.011 -6409.0
## - garagearea     1   0.03463 15.014 -6408.8
## - enclosedporch  1   0.03799 15.017 -6408.4
## - halfbath       1   0.04329 15.022 -6407.9
## - bsmtunfsf      1   0.04408 15.023 -6407.9
## - extercond      4   0.12050 15.099 -6406.4
## - openporchsf    1   0.06903 15.048 -6405.4
## - lotconfig      4   0.13181 15.111 -6405.4
## - yearremodadd   1   0.07239 15.051 -6405.1
## - foundation     5   0.15728 15.136 -6404.9
## - bsmtfullbath   1   0.08200 15.061 -6404.2
## - garagecars     1   0.08611 15.065 -6403.8
## - wooddecksf     1   0.09402 15.073 -6403.0
## - heatingqc      4   0.17538 15.154 -6401.1
## - saletype       8   0.26356 15.242 -6400.7
## - heating        5   0.20792 15.187 -6400.0
## - bsmtexposure   4   0.22125 15.200 -6396.7
## - fireplaces     1   0.16222 15.141 -6396.4
## - lotarea        1   0.21660 15.195 -6391.2
## - totalbsmtsf    1   0.25335 15.232 -6387.7
## - exterior1st   14   0.53074 15.510 -6387.3
## - kitchenqual    3   0.30529 15.284 -6386.7
## - bldgtype       4   0.35898 15.338 -6383.6
## - salecondition  5   0.42108 15.400 -6379.7
## - condition1     8   0.50134 15.480 -6378.1
## - grlivarea      1   0.48575 15.465 -6365.6
## - yearbuilt      1   0.51255 15.491 -6363.0
## - x2ndflrsf      1   0.75011 15.729 -6340.8
## - functional     6   0.91316 15.892 -6335.7
## - x1stflrsf      1   0.99143 15.970 -6318.6
## - mszoning       4   1.13402 16.113 -6311.6
## - neighborhood  24   1.58911 16.568 -6310.9
## - overallqual    1   1.31185 16.291 -6289.6
## - overallcond    1   1.46031 16.439 -6276.3
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6411.62
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     kitchenqual + functional + fireplaces + garagetype + garagecars + 
##     garagearea + wooddecksf + openporchsf + enclosedporch + saletype + 
##     salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - masvnrtype     3   0.05412 15.038 -6412.4
## - landcontour    3   0.05989 15.044 -6411.8
## - fullbath       1   0.01964 15.004 -6411.7
## <none>                       14.984 -6411.6
## - lotfrontage    1   0.02429 15.009 -6411.3
## - bsmtfinsf1     1   0.03212 15.016 -6410.5
## - masvnrarea     1   0.03229 15.017 -6410.5
## - enclosedporch  1   0.03839 15.023 -6409.9
## - halfbath       1   0.04434 15.029 -6409.3
## - bsmtunfsf      1   0.04481 15.029 -6409.3
## - garagearea     1   0.04791 15.032 -6409.0
## - extercond      4   0.12024 15.104 -6408.0
## - garagetype     6   0.16605 15.150 -6407.5
## - openporchsf    1   0.06988 15.054 -6406.8
## - lotconfig      4   0.13430 15.119 -6406.6
## - foundation     5   0.15983 15.144 -6406.1
## - yearremodadd   1   0.07937 15.064 -6405.9
## - bsmtfullbath   1   0.08043 15.065 -6405.8
## - garagecars     1   0.08678 15.071 -6405.2
## - wooddecksf     1   0.09898 15.083 -6404.0
## - heatingqc      4   0.17837 15.163 -6402.3
## - saletype       8   0.26466 15.249 -6402.1
## - heating        5   0.20442 15.189 -6401.8
## - bsmtexposure   4   0.21991 15.204 -6398.3
## - fireplaces     1   0.15840 15.143 -6398.3
## - lotarea        1   0.21251 15.197 -6393.1
## - totalbsmtsf    1   0.25245 15.237 -6389.2
## - exterior1st   14   0.52670 15.511 -6389.2
## - kitchenqual    3   0.30609 15.290 -6388.1
## - bldgtype       4   0.35699 15.341 -6385.2
## - salecondition  5   0.42244 15.407 -6381.0
## - condition1     8   0.50162 15.486 -6379.5
## - grlivarea      1   0.48938 15.474 -6366.7
## - yearbuilt      1   0.56699 15.551 -6359.4
## - x2ndflrsf      1   0.74480 15.729 -6342.8
## - functional     6   0.91717 15.901 -6336.9
## - x1stflrsf      1   0.98793 15.972 -6320.4
## - mszoning       4   1.12954 16.114 -6313.5
## - neighborhood  24   1.58420 16.569 -6312.9
## - overallqual    1   1.31484 16.299 -6290.8
## - overallcond    1   1.45521 16.439 -6278.3
## 
## Step:  AIC=-6412.36
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrarea + 
##     extercond + foundation + bsmtexposure + bsmtfinsf1 + bsmtunfsf + 
##     totalbsmtsf + heating + heatingqc + x1stflrsf + x2ndflrsf + 
##     grlivarea + bsmtfullbath + fullbath + halfbath + kitchenqual + 
##     functional + fireplaces + garagetype + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - masvnrarea     1   0.01632 15.055 -6412.8
## - landcontour    3   0.06139 15.100 -6412.4
## <none>                       15.038 -6412.4
## - fullbath       1   0.02094 15.059 -6412.3
## - lotfrontage    1   0.02180 15.060 -6412.2
## - halfbath       1   0.03917 15.078 -6410.6
## - bsmtfinsf1     1   0.03924 15.078 -6410.6
## - bsmtunfsf      1   0.04058 15.079 -6410.4
## - enclosedporch  1   0.04090 15.079 -6410.4
## - garagearea     1   0.04229 15.081 -6410.3
## - garagetype     6   0.15499 15.193 -6409.4
## - extercond      4   0.12048 15.159 -6408.7
## - lotconfig      4   0.13045 15.169 -6407.7
## - openporchsf    1   0.06936 15.108 -6407.6
## - foundation     5   0.16054 15.199 -6406.9
## - yearremodadd   1   0.07994 15.118 -6406.6
## - bsmtfullbath   1   0.08299 15.121 -6406.3
## - garagecars     1   0.09924 15.138 -6404.8
## - wooddecksf     1   0.10074 15.139 -6404.6
## - saletype       8   0.26179 15.300 -6403.2
## - heating        5   0.20525 15.244 -6402.6
## - heatingqc      4   0.18462 15.223 -6402.5
## - bsmtexposure   4   0.22512 15.264 -6398.7
## - fireplaces     1   0.16491 15.203 -6398.4
## - lotarea        1   0.20808 15.246 -6394.3
## - exterior1st   14   0.50839 15.547 -6391.8
## - totalbsmtsf    1   0.24078 15.279 -6391.2
## - kitchenqual    3   0.29526 15.334 -6390.0
## - bldgtype       4   0.33350 15.372 -6388.3
## - salecondition  5   0.42111 15.460 -6382.0
## - condition1     8   0.50984 15.548 -6379.7
## - grlivarea      1   0.48344 15.522 -6368.2
## - yearbuilt      1   0.58614 15.624 -6358.5
## - x2ndflrsf      1   0.74265 15.781 -6344.0
## - functional     6   0.92415 15.963 -6337.3
## - x1stflrsf      1   1.00402 16.042 -6320.0
## - mszoning       4   1.11138 16.150 -6316.3
## - neighborhood  24   1.59800 16.636 -6312.9
## - overallqual    1   1.37780 16.416 -6286.4
## - overallcond    1   1.44613 16.485 -6280.3
## 
## Step:  AIC=-6412.77
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + extercond + 
##     foundation + bsmtexposure + bsmtfinsf1 + bsmtunfsf + totalbsmtsf + 
##     heating + heatingqc + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + kitchenqual + functional + 
##     fireplaces + garagetype + garagecars + garagearea + wooddecksf + 
##     openporchsf + enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## <none>                       15.055 -6412.8
## - fullbath       1   0.02099 15.076 -6412.7
## - landcontour    3   0.06424 15.119 -6412.6
## - lotfrontage    1   0.02382 15.079 -6412.5
## - bsmtfinsf1     1   0.03616 15.091 -6411.3
## - halfbath       1   0.03691 15.092 -6411.2
## - garagearea     1   0.03872 15.093 -6411.0
## - enclosedporch  1   0.04085 15.096 -6410.8
## - bsmtunfsf      1   0.04275 15.098 -6410.6
## - garagetype     6   0.15730 15.212 -6409.6
## - extercond      4   0.12115 15.176 -6409.1
## - lotconfig      4   0.13046 15.185 -6408.2
## - openporchsf    1   0.07056 15.125 -6407.9
## - foundation     5   0.16035 15.215 -6407.3
## - yearremodadd   1   0.08339 15.138 -6406.7
## - bsmtfullbath   1   0.08641 15.141 -6406.4
## - garagecars     1   0.09624 15.151 -6405.5
## - wooddecksf     1   0.09912 15.154 -6405.2
## - saletype       8   0.26075 15.316 -6403.7
## - heatingqc      4   0.18284 15.238 -6403.1
## - heating        5   0.20658 15.261 -6402.9
## - bsmtexposure   4   0.22182 15.277 -6399.4
## - fireplaces     1   0.16082 15.216 -6399.3
## - lotarea        1   0.21061 15.265 -6394.5
## - totalbsmtsf    1   0.24209 15.297 -6391.5
## - kitchenqual    3   0.28735 15.342 -6391.2
## - exterior1st   14   0.52650 15.581 -6390.6
## - bldgtype       4   0.33868 15.393 -6388.3
## - salecondition  5   0.41736 15.472 -6382.8
## - condition1     8   0.51485 15.570 -6379.7
## - grlivarea      1   0.47278 15.527 -6369.6
## - yearbuilt      1   0.57588 15.631 -6360.0
## - x2ndflrsf      1   0.74993 15.805 -6343.8
## - functional     6   0.91867 15.973 -6338.3
## - x1stflrsf      1   1.00807 16.063 -6320.1
## - mszoning       4   1.11271 16.167 -6316.7
## - neighborhood  24   1.58189 16.637 -6314.9
## - overallqual    1   1.36595 16.421 -6288.0
## - overallcond    1   1.44855 16.503 -6280.6
    step$anova # display results 
## Stepwise Model Path 
## Analysis of Deviance Table
## 
## Initial Model:
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + roofstyle + exterior1st + masvnrtype + masvnrarea + 
##     exterqual + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + electrical + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + fireplacequ + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## 
## Final Model:
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + extercond + 
##     foundation + bsmtexposure + bsmtfinsf1 + bsmtunfsf + totalbsmtsf + 
##     heating + heatingqc + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + kitchenqual + functional + 
##     fireplaces + garagetype + garagecars + garagearea + wooddecksf + 
##     openporchsf + enclosedporch + saletype + salecondition
## 
## 
##              Step Df     Deviance Resid. Df Resid. Dev       AIC
## 1                                      1280   14.60957 -6362.592
## 2     - roofstyle  5 0.0164471490      1285   14.62602 -6370.949
## 3  - bsmtfintype2  6 0.0514553388      1291   14.67747 -6377.822
## 4   - fireplacequ  5 0.0445989385      1296   14.72207 -6383.392
## 5     - exterqual  3 0.0045736392      1299   14.72664 -6388.939
## 6    - electrical  5 0.0460971660      1304   14.77274 -6394.376
## 7    - housestyle  7 0.1038392696      1311   14.87658 -6398.149
## 8      - lotshape  3 0.0257587607      1314   14.90234 -6401.623
## 9     - landslope  2 0.0098829354      1316   14.91222 -6404.655
## 10     - bsmtqual  4 0.0636765775      1320   14.97590 -6406.434
## 11 - bedroomabvgr  1 0.0007551971      1321   14.97665 -6408.361
## 12 - totrmsabvgrd  1 0.0022125584      1322   14.97887 -6410.145
## 13  - garageyrblt  1 0.0053959178      1323   14.98426 -6411.619
## 14   - masvnrtype  3 0.0541228596      1326   15.03839 -6412.355
## 15   - masvnrarea  1 0.0163195466      1327   15.05471 -6412.772
    plot(predict(fit_backward, newdata = test_homes))
    
    test_homes$pred_bwd_log_saleprice <- predict(fit_backward, newdata = test_homes)
    
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   submittal file - backward selection
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    df_submit_bwd <- data.frame(test_homes$id, exp(test_homes$pred_bwd_log_saleprice))
    names(df_submit_bwd) <- c("Id", "SalePrice")
    
    df_submit_bwd$SalePrice[is.na(df_submit_bwd$SalePrice)] <- median(df_submit_bwd$SalePrice, na.rm = TRUE)

    write.csv(df_submit_bwd, file = "submit_test_pred_bwd_selection.csv", row.names = FALSE)

    
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#  ...  Stepwise Regression - both
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

library (MASS)
    
    homes_subset <- homes_subset_base

    fit_both <- lm (log_saleprice ~ ., data = homes_subset)
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
    step <- stepAIC(fit_both, direction = "both")
## Start:  AIC=-6362.59
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + roofstyle + exterior1st + masvnrtype + masvnrarea + 
##     exterqual + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + electrical + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + fireplacequ + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## 
##                 Df Sum of Sq    RSS     AIC
## - roofstyle      5   0.01645 14.626 -6370.9
## - bsmtfintype2   6   0.05027 14.660 -6369.6
## - fireplacequ    5   0.04562 14.655 -6368.0
## - exterqual      3   0.00588 14.615 -6368.0
## - electrical     5   0.04715 14.657 -6367.9
## - housestyle     7   0.10490 14.714 -6366.1
## - landslope      2   0.01312 14.623 -6365.3
## - lotshape       3   0.03659 14.646 -6364.9
## - bsmtfinsf1     1   0.00183 14.611 -6364.4
## - garageyrblt    1   0.00234 14.612 -6364.4
## - totrmsabvgrd   1   0.00582 14.615 -6364.0
## - bedroomabvgr   1   0.00660 14.616 -6363.9
## - bsmtqual       4   0.06700 14.677 -6363.9
## - fireplaces     1   0.01648 14.626 -6362.9
## - fullbath       1   0.01654 14.626 -6362.9
## <none>                       14.610 -6362.6
## - lotfrontage    1   0.02008 14.630 -6362.6
## - masvnrtype     3   0.06174 14.671 -6362.4
## - garagetype     6   0.12248 14.732 -6362.4
## - landcontour    3   0.06903 14.679 -6361.7
## - bsmtunfsf      1   0.03090 14.640 -6361.5
## - halfbath       1   0.04138 14.651 -6360.5
## - masvnrarea     1   0.04142 14.651 -6360.5
## - lotconfig      4   0.10313 14.713 -6360.3
## - enclosedporch  1   0.04712 14.657 -6359.9
## - garagearea     1   0.04860 14.658 -6359.7
## - extercond      4   0.10917 14.719 -6359.7
## - bsmtexposure   4   0.12554 14.735 -6358.1
## - openporchsf    1   0.06809 14.678 -6357.8
## - garagecars     1   0.07322 14.683 -6357.3
## - wooddecksf     1   0.08512 14.695 -6356.1
## - yearremodadd   1   0.08748 14.697 -6355.9
## - saletype       8   0.23491 14.845 -6355.3
## - bsmtfullbath   1   0.09528 14.705 -6355.1
## - heatingqc      4   0.16236 14.772 -6354.5
## - foundation     5   0.19201 14.802 -6353.5
## - heating        5   0.21065 14.820 -6351.7
## - totalbsmtsf    1   0.16727 14.777 -6348.0
## - lotarea        1   0.17002 14.780 -6347.7
## - kitchenqual    3   0.21834 14.828 -6346.9
## - exterior1st   14   0.46908 15.079 -6344.5
## - bldgtype       4   0.31815 14.928 -6339.1
## - salecondition  5   0.40092 15.011 -6333.1
## - condition1     8   0.51826 15.128 -6327.7
## - grlivarea      1   0.39887 15.008 -6325.3
## - yearbuilt      1   0.43911 15.049 -6321.4
## - x2ndflrsf      1   0.48112 15.091 -6317.3
## - functional     6   0.88339 15.493 -6288.9
## - x1stflrsf      1   0.78642 15.396 -6288.0
## - neighborhood  24   1.44487 16.054 -6272.9
## - mszoning       4   1.07153 15.681 -6267.3
## - overallqual    1   1.08079 15.690 -6260.4
## - overallcond    1   1.43865 16.048 -6227.5
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6370.95
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + exterqual + 
##     extercond + foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + 
##     bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + heatingqc + 
##     electrical + x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + 
##     fullbath + halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + 
##     functional + fireplaces + fireplacequ + garagetype + garageyrblt + 
##     garagecars + garagearea + wooddecksf + openporchsf + enclosedporch + 
##     saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - bsmtfintype2   6   0.05146 14.678 -6377.8
## - exterqual      3   0.00505 14.631 -6376.4
## - electrical     5   0.04736 14.673 -6376.2
## - fireplacequ    5   0.04972 14.676 -6376.0
## - housestyle     7   0.10560 14.732 -6374.4
## - landslope      2   0.01264 14.639 -6373.7
## - lotshape       3   0.03548 14.662 -6373.4
## - bsmtfinsf1     1   0.00154 14.628 -6372.8
## - garageyrblt    1   0.00306 14.629 -6372.6
## - bsmtqual       4   0.06691 14.693 -6372.3
## - totrmsabvgrd   1   0.00689 14.633 -6372.3
## - bedroomabvgr   1   0.00729 14.633 -6372.2
## - fireplaces     1   0.01601 14.642 -6371.4
## - fullbath       1   0.01720 14.643 -6371.2
## <none>                       14.626 -6370.9
## - garagetype     6   0.12166 14.748 -6370.9
## - masvnrtype     3   0.06160 14.688 -6370.8
## - lotfrontage    1   0.02233 14.648 -6370.7
## - landcontour    3   0.07131 14.697 -6369.8
## - bsmtunfsf      1   0.03334 14.659 -6369.6
## - masvnrarea     1   0.04083 14.667 -6368.9
## - enclosedporch  1   0.04385 14.670 -6368.6
## - extercond      4   0.10674 14.733 -6368.3
## - halfbath       1   0.04807 14.674 -6368.2
## - garagearea     1   0.04856 14.675 -6368.1
## - lotconfig      4   0.10991 14.736 -6368.0
## - openporchsf    1   0.06747 14.694 -6366.2
## - bsmtexposure   4   0.13064 14.757 -6366.0
## - garagecars     1   0.07439 14.700 -6365.5
## - yearremodadd   1   0.08600 14.712 -6364.4
## - wooddecksf     1   0.08796 14.714 -6364.2
## - saletype       8   0.23286 14.859 -6363.9
## - bsmtfullbath   1   0.09219 14.718 -6363.8
## + roofstyle      5   0.01645 14.610 -6362.6
## - heatingqc      4   0.16800 14.794 -6362.3
## - foundation     5   0.20176 14.828 -6360.9
## - heating        5   0.21186 14.838 -6360.0
## - totalbsmtsf    1   0.16935 14.795 -6356.1
## - kitchenqual    3   0.22056 14.847 -6355.1
## - lotarea        1   0.18102 14.807 -6355.0
## - exterior1st   14   0.46782 15.094 -6353.0
## - bldgtype       4   0.31574 14.942 -6347.8
## - salecondition  5   0.40186 15.028 -6341.4
## - condition1     8   0.51807 15.144 -6336.1
## - grlivarea      1   0.40495 15.031 -6333.1
## - yearbuilt      1   0.43191 15.058 -6330.5
## - x2ndflrsf      1   0.48415 15.110 -6325.4
## - functional     6   0.88671 15.513 -6297.0
## - x1stflrsf      1   0.79072 15.417 -6296.1
## - neighborhood  24   1.43844 16.064 -6282.0
## - mszoning       4   1.09579 15.722 -6273.5
## - overallqual    1   1.10357 15.730 -6266.7
## - overallcond    1   1.43725 16.063 -6236.1
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6377.82
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + exterqual + 
##     extercond + foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + electrical + 
##     x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + fullbath + 
##     halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + fireplacequ + garagetype + garageyrblt + garagecars + 
##     garagearea + wooddecksf + openporchsf + enclosedporch + saletype + 
##     salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - fireplacequ    5   0.04460 14.722 -6383.4
## - exterqual      3   0.00545 14.683 -6383.3
## - electrical     5   0.04661 14.724 -6383.2
## - housestyle     7   0.09786 14.775 -6382.1
## - landslope      2   0.01153 14.689 -6380.7
## - lotshape       3   0.03508 14.713 -6380.3
## - bsmtqual       4   0.06020 14.738 -6379.8
## - garageyrblt    1   0.00255 14.680 -6379.6
## - bedroomabvgr   1   0.00565 14.683 -6379.3
## - totrmsabvgrd   1   0.00648 14.684 -6379.2
## - fireplaces     1   0.01438 14.692 -6378.4
## - fullbath       1   0.01731 14.695 -6378.1
## <none>                       14.678 -6377.8
## - masvnrtype     3   0.06227 14.740 -6377.6
## - lotfrontage    1   0.02227 14.700 -6377.6
## - garagetype     6   0.12821 14.806 -6377.1
## - landcontour    3   0.07025 14.748 -6376.9
## - bsmtfinsf1     1   0.03206 14.710 -6376.6
## - masvnrarea     1   0.03875 14.716 -6376.0
## - bsmtunfsf      1   0.04084 14.718 -6375.8
## - garagearea     1   0.04278 14.720 -6375.6
## - enclosedporch  1   0.04413 14.722 -6375.4
## - extercond      4   0.10814 14.786 -6375.1
## - lotconfig      4   0.11089 14.788 -6374.8
## - halfbath       1   0.05049 14.728 -6374.8
## - openporchsf    1   0.06973 14.747 -6372.9
## - garagecars     1   0.07866 14.756 -6372.0
## - bsmtexposure   4   0.14580 14.823 -6371.4
## - wooddecksf     1   0.08544 14.763 -6371.3
## - yearremodadd   1   0.08552 14.763 -6371.3
## + bsmtfintype2   6   0.05146 14.626 -6370.9
## - bsmtfullbath   1   0.09132 14.769 -6370.8
## + roofstyle      5   0.01763 14.660 -6369.6
## - saletype       8   0.24582 14.923 -6369.6
## - heatingqc      4   0.17009 14.848 -6369.0
## - foundation     5   0.20106 14.879 -6368.0
## - heating        5   0.21408 14.892 -6366.7
## - kitchenqual    3   0.22352 14.901 -6361.8
## - lotarea        1   0.19258 14.870 -6360.8
## - exterior1st   14   0.48778 15.165 -6358.1
## - bldgtype       4   0.30810 14.986 -6355.5
## - totalbsmtsf    1   0.27611 14.954 -6352.6
## - salecondition  5   0.40995 15.087 -6347.6
## - condition1     8   0.52066 15.198 -6342.9
## - grlivarea      1   0.41059 15.088 -6339.5
## - yearbuilt      1   0.44866 15.126 -6335.9
## - x2ndflrsf      1   0.48292 15.160 -6332.6
## - functional     6   0.88025 15.558 -6304.8
## - x1stflrsf      1   0.82248 15.500 -6300.2
## - neighborhood  24   1.45880 16.136 -6287.5
## - mszoning       4   1.10117 15.779 -6280.2
## - overallqual    1   1.11991 15.797 -6272.5
## - overallcond    1   1.44117 16.119 -6243.1
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6383.39
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + exterqual + 
##     extercond + foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + electrical + 
##     x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + fullbath + 
##     halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + garagetype + garageyrblt + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - exterqual      3   0.00457 14.727 -6388.9
## - electrical     5   0.04584 14.768 -6388.9
## - housestyle     7   0.09841 14.820 -6387.7
## - landslope      2   0.01197 14.734 -6386.2
## - lotshape       3   0.03259 14.755 -6386.2
## - garageyrblt    1   0.00264 14.725 -6385.1
## - totrmsabvgrd   1   0.00409 14.726 -6385.0
## - bsmtqual       4   0.06541 14.787 -6384.9
## - bedroomabvgr   1   0.00574 14.728 -6384.8
## - fullbath       1   0.01409 14.736 -6384.0
## <none>                       14.722 -6383.4
## - masvnrtype     3   0.06383 14.786 -6383.1
## - lotfrontage    1   0.02564 14.748 -6382.9
## - garagetype     6   0.13024 14.852 -6382.5
## - landcontour    3   0.06961 14.792 -6382.5
## - bsmtfinsf1     1   0.02989 14.752 -6382.4
## - masvnrarea     1   0.03697 14.759 -6381.7
## - enclosedporch  1   0.03904 14.761 -6381.5
## - bsmtunfsf      1   0.04016 14.762 -6381.4
## - garagearea     1   0.04373 14.766 -6381.1
## - lotconfig      4   0.10812 14.830 -6380.7
## - halfbath       1   0.05032 14.772 -6380.4
## - extercond      4   0.11265 14.835 -6380.3
## - openporchsf    1   0.06680 14.789 -6378.8
## + fireplacequ    5   0.04460 14.678 -6377.8
## - garagecars     1   0.07934 14.801 -6377.5
## - yearremodadd   1   0.08318 14.805 -6377.2
## - bsmtexposure   4   0.14665 14.869 -6376.9
## - bsmtfullbath   1   0.08729 14.809 -6376.8
## - wooddecksf     1   0.08759 14.810 -6376.7
## + bsmtfintype2   6   0.04633 14.676 -6376.0
## + roofstyle      5   0.02185 14.700 -6375.6
## - saletype       8   0.24887 14.971 -6374.9
## - heatingqc      4   0.17114 14.893 -6374.5
## - foundation     5   0.20124 14.923 -6373.6
## - heating        5   0.21033 14.932 -6372.7
## - fireplaces     1   0.16227 14.884 -6369.4
## - kitchenqual    3   0.22400 14.946 -6367.3
## - lotarea        1   0.19299 14.915 -6366.4
## - exterior1st   14   0.49262 15.215 -6363.3
## - bldgtype       4   0.30988 15.032 -6361.0
## - totalbsmtsf    1   0.27719 14.999 -6358.2
## - salecondition  5   0.41703 15.139 -6352.6
## - condition1     8   0.51772 15.240 -6348.9
## - grlivarea      1   0.42903 15.151 -6343.5
## - yearbuilt      1   0.43901 15.161 -6342.5
## - x2ndflrsf      1   0.47495 15.197 -6339.0
## - functional     6   0.87515 15.597 -6311.1
## - x1stflrsf      1   0.79983 15.522 -6308.2
## - neighborhood  24   1.48529 16.207 -6291.1
## - mszoning       4   1.10269 15.825 -6285.9
## - overallqual    1   1.12705 15.849 -6277.7
## - overallcond    1   1.43263 16.155 -6249.8
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6388.94
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + extercond + 
##     foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + bsmtunfsf + 
##     totalbsmtsf + heating + heatingqc + electrical + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + garagetype + garageyrblt + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - electrical     5   0.04610 14.773 -6394.4
## - housestyle     7   0.09936 14.826 -6393.1
## - lotshape       3   0.03233 14.759 -6391.7
## - landslope      2   0.01236 14.739 -6391.7
## - garageyrblt    1   0.00244 14.729 -6390.7
## - totrmsabvgrd   1   0.00417 14.731 -6390.5
## - bsmtqual       4   0.06557 14.792 -6390.5
## - bedroomabvgr   1   0.00608 14.733 -6390.3
## - fullbath       1   0.01404 14.741 -6389.5
## <none>                       14.727 -6388.9
## - masvnrtype     3   0.06270 14.789 -6388.7
## - lotfrontage    1   0.02570 14.752 -6388.4
## - landcontour    3   0.06844 14.795 -6388.2
## - garagetype     6   0.13020 14.857 -6388.1
## - bsmtfinsf1     1   0.03010 14.757 -6388.0
## - masvnrarea     1   0.03774 14.764 -6387.2
## - enclosedporch  1   0.03942 14.766 -6387.0
## - bsmtunfsf      1   0.04075 14.767 -6386.9
## - garagearea     1   0.04332 14.770 -6386.6
## - lotconfig      4   0.10830 14.835 -6386.2
## - halfbath       1   0.05004 14.777 -6386.0
## - extercond      4   0.11438 14.841 -6385.6
## - openporchsf    1   0.06696 14.794 -6384.3
## + exterqual      3   0.00457 14.722 -6383.4
## + fireplacequ    5   0.04372 14.683 -6383.3
## - garagecars     1   0.07981 14.806 -6383.0
## - yearremodadd   1   0.08292 14.810 -6382.7
## - bsmtfullbath   1   0.08638 14.813 -6382.4
## - bsmtexposure   4   0.14843 14.875 -6382.3
## - wooddecksf     1   0.08910 14.816 -6382.1
## + bsmtfintype2   6   0.04673 14.680 -6381.6
## + roofstyle      5   0.02121 14.705 -6381.0
## - saletype       8   0.25017 14.977 -6380.3
## - heatingqc      4   0.16839 14.895 -6380.3
## - foundation     5   0.19913 14.926 -6379.3
## - heating        5   0.20999 14.937 -6378.3
## - fireplaces     1   0.16181 14.889 -6375.0
## - lotarea        1   0.19192 14.919 -6372.0
## - kitchenqual    3   0.23866 14.965 -6371.5
## - exterior1st   14   0.49231 15.219 -6368.9
## - bldgtype       4   0.31248 15.039 -6366.3
## - totalbsmtsf    1   0.27590 15.002 -6363.8
## - salecondition  5   0.41532 15.142 -6358.3
## - condition1     8   0.51726 15.244 -6354.5
## - grlivarea      1   0.43154 15.158 -6348.8
## - yearbuilt      1   0.43822 15.165 -6348.1
## - x2ndflrsf      1   0.47558 15.202 -6344.5
## - functional     6   0.88982 15.617 -6315.3
## - x1stflrsf      1   0.80825 15.535 -6312.9
## - neighborhood  24   1.48855 16.215 -6296.4
## - mszoning       4   1.12345 15.850 -6289.6
## - overallqual    1   1.14004 15.867 -6282.1
## - overallcond    1   1.43710 16.164 -6255.0
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6394.38
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + exterior1st + masvnrtype + masvnrarea + extercond + 
##     foundation + bsmtqual + bsmtexposure + bsmtfinsf1 + bsmtunfsf + 
##     totalbsmtsf + heating + heatingqc + x1stflrsf + x2ndflrsf + 
##     grlivarea + bsmtfullbath + fullbath + halfbath + bedroomabvgr + 
##     kitchenqual + totrmsabvgrd + functional + fireplaces + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - housestyle     7   0.10384 14.877 -6398.1
## - lotshape       3   0.02869 14.801 -6397.5
## - landslope      2   0.01336 14.786 -6397.1
## - totrmsabvgrd   1   0.00300 14.776 -6396.1
## - garageyrblt    1   0.00307 14.776 -6396.1
## - bsmtqual       4   0.06573 14.838 -6395.9
## - bedroomabvgr   1   0.00554 14.778 -6395.8
## - fullbath       1   0.01283 14.786 -6395.1
## <none>                       14.773 -6394.4
## - masvnrtype     3   0.06098 14.834 -6394.4
## - garagetype     6   0.12472 14.898 -6394.1
## - lotfrontage    1   0.02586 14.799 -6393.8
## - bsmtfinsf1     1   0.03074 14.803 -6393.3
## - landcontour    3   0.07451 14.847 -6393.0
## - enclosedporch  1   0.03493 14.808 -6392.9
## - masvnrarea     1   0.03684 14.810 -6392.7
## - garagearea     1   0.04023 14.813 -6392.4
## - bsmtunfsf      1   0.04041 14.813 -6392.4
## - lotconfig      4   0.11061 14.883 -6391.5
## - halfbath       1   0.05010 14.823 -6391.4
## - extercond      4   0.11736 14.890 -6390.8
## - openporchsf    1   0.06832 14.841 -6389.6
## + electrical     5   0.04610 14.727 -6388.9
## + exterqual      3   0.00483 14.768 -6388.9
## + fireplacequ    5   0.04284 14.730 -6388.6
## - garagecars     1   0.08154 14.854 -6388.3
## - yearremodadd   1   0.08280 14.855 -6388.2
## - bsmtfullbath   1   0.08353 14.856 -6388.1
## - wooddecksf     1   0.08787 14.861 -6387.7
## - bsmtexposure   4   0.14948 14.922 -6387.7
## + bsmtfintype2   6   0.04598 14.727 -6386.9
## + roofstyle      5   0.02150 14.751 -6386.5
## - saletype       8   0.24881 15.022 -6386.0
## - foundation     5   0.18762 14.960 -6386.0
## - heatingqc      4   0.16793 14.941 -6385.9
## - heating        5   0.20527 14.978 -6384.2
## - fireplaces     1   0.15878 14.931 -6380.8
## - lotarea        1   0.19532 14.968 -6377.2
## - kitchenqual    3   0.24361 15.016 -6376.5
## - exterior1st   14   0.52092 15.294 -6371.8
## - bldgtype       4   0.32153 15.094 -6370.9
## - totalbsmtsf    1   0.27124 15.044 -6369.8
## - salecondition  5   0.39684 15.170 -6365.7
## - condition1     8   0.51513 15.288 -6360.3
## - grlivarea      1   0.42885 15.202 -6354.6
## - yearbuilt      1   0.43047 15.203 -6354.4
## - x2ndflrsf      1   0.48553 15.258 -6349.2
## - functional     6   0.89170 15.664 -6320.8
## - x1stflrsf      1   0.81438 15.587 -6318.0
## - neighborhood  24   1.50263 16.275 -6300.9
## - mszoning       4   1.13368 15.906 -6294.4
## - overallqual    1   1.13215 15.905 -6288.6
## - overallcond    1   1.42951 16.202 -6261.5
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6398.15
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + overallqual + overallcond + yearbuilt + yearremodadd + 
##     exterior1st + masvnrtype + masvnrarea + extercond + foundation + 
##     bsmtqual + bsmtexposure + bsmtfinsf1 + bsmtunfsf + totalbsmtsf + 
##     heating + heatingqc + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + garagetype + garageyrblt + 
##     garagecars + garagearea + wooddecksf + openporchsf + enclosedporch + 
##     saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - lotshape       3   0.02576 14.902 -6401.6
## - landslope      2   0.00924 14.886 -6401.2
## - totrmsabvgrd   1   0.00213 14.879 -6399.9
## - bsmtqual       4   0.06378 14.940 -6399.9
## - bedroomabvgr   1   0.00261 14.879 -6399.9
## - garageyrblt    1   0.00399 14.881 -6399.8
## - fullbath       1   0.01386 14.890 -6398.8
## - masvnrtype     3   0.05613 14.933 -6398.7
## <none>                       14.877 -6398.1
## - landcontour    3   0.06316 14.940 -6398.0
## - lotfrontage    1   0.02310 14.900 -6397.9
## - garagetype     6   0.12737 15.004 -6397.7
## - bsmtfinsf1     1   0.03042 14.907 -6397.2
## - masvnrarea     1   0.03779 14.914 -6396.4
## - enclosedporch  1   0.03780 14.914 -6396.4
## - garagearea     1   0.03903 14.916 -6396.3
## - bsmtunfsf      1   0.03996 14.916 -6396.2
## - halfbath       1   0.04285 14.919 -6395.9
## - lotconfig      4   0.11198 14.989 -6395.2
## - extercond      4   0.11928 14.996 -6394.5
## + housestyle     7   0.10384 14.773 -6394.4
## - openporchsf    1   0.05912 14.936 -6394.4
## - yearremodadd   1   0.06941 14.946 -6393.4
## + electrical     5   0.05058 14.826 -6393.1
## + exterqual      3   0.00592 14.871 -6392.7
## - garagecars     1   0.07590 14.953 -6392.7
## + fireplacequ    5   0.04256 14.834 -6392.3
## - foundation     5   0.16631 15.043 -6391.9
## - wooddecksf     1   0.08487 14.961 -6391.8
## - bsmtfullbath   1   0.08518 14.962 -6391.8
## + roofstyle      5   0.02141 14.855 -6390.3
## + bsmtfintype2   6   0.03926 14.837 -6390.0
## - heatingqc      4   0.17517 15.052 -6389.1
## - saletype       8   0.26149 15.138 -6388.7
## - bsmtexposure   4   0.18013 15.057 -6388.6
## - heating        5   0.20963 15.086 -6387.7
## - fireplaces     1   0.16921 15.046 -6383.6
## - lotarea        1   0.18485 15.061 -6382.1
## - kitchenqual    3   0.24218 15.119 -6380.6
## - exterior1st   14   0.51906 15.396 -6376.1
## - totalbsmtsf    1   0.25365 15.130 -6375.5
## - bldgtype       4   0.33179 15.208 -6373.9
## - salecondition  5   0.41027 15.287 -6368.4
## - condition1     8   0.49403 15.371 -6366.5
## - yearbuilt      1   0.42444 15.301 -6359.1
## - grlivarea      1   0.47423 15.351 -6354.3
## - x2ndflrsf      1   0.66315 15.540 -6336.5
## - functional     6   0.90371 15.780 -6324.0
## - x1stflrsf      1   0.90811 15.785 -6313.6
## - neighborhood  24   1.51257 16.389 -6304.8
## - mszoning       4   1.13615 16.013 -6298.7
## - overallqual    1   1.22371 16.100 -6284.7
## - overallcond    1   1.45216 16.329 -6264.2
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6401.62
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + landslope + neighborhood + condition1 + bldgtype + 
##     overallqual + overallcond + yearbuilt + yearremodadd + exterior1st + 
##     masvnrtype + masvnrarea + extercond + foundation + bsmtqual + 
##     bsmtexposure + bsmtfinsf1 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + 
##     fullbath + halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + 
##     functional + fireplaces + garagetype + garageyrblt + garagecars + 
##     garagearea + wooddecksf + openporchsf + enclosedporch + saletype + 
##     salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - landslope      2   0.00988 14.912 -6404.7
## - totrmsabvgrd   1   0.00240 14.905 -6403.4
## - bsmtqual       4   0.06388 14.966 -6403.4
## - bedroomabvgr   1   0.00291 14.905 -6403.3
## - garageyrblt    1   0.00428 14.907 -6403.2
## - masvnrtype     3   0.05244 14.955 -6402.5
## - fullbath       1   0.01465 14.917 -6402.2
## <none>                       14.902 -6401.6
## - lotfrontage    1   0.02124 14.924 -6401.5
## - landcontour    3   0.06268 14.965 -6401.5
## - garagetype     6   0.12786 15.030 -6401.1
## - bsmtfinsf1     1   0.02741 14.930 -6400.9
## - enclosedporch  1   0.03584 14.938 -6400.1
## - masvnrarea     1   0.03646 14.939 -6400.1
## - garagearea     1   0.03778 14.940 -6399.9
## - halfbath       1   0.04172 14.944 -6399.5
## - bsmtunfsf      1   0.04490 14.947 -6399.2
## + lotshape       3   0.02576 14.877 -6398.1
## - extercond      4   0.11880 15.021 -6398.0
## - openporchsf    1   0.06197 14.964 -6397.6
## + housestyle     7   0.10091 14.801 -6397.5
## - lotconfig      4   0.12639 15.029 -6397.3
## - yearremodadd   1   0.07232 14.975 -6396.6
## + electrical     5   0.04723 14.855 -6396.3
## + exterqual      3   0.00593 14.896 -6396.2
## - foundation     5   0.15922 15.062 -6396.1
## - garagecars     1   0.07752 14.980 -6396.0
## - bsmtfullbath   1   0.08089 14.983 -6395.7
## + fireplacequ    5   0.04068 14.862 -6395.6
## - wooddecksf     1   0.08332 14.986 -6395.5
## + roofstyle      5   0.02001 14.882 -6393.6
## + bsmtfintype2   6   0.03968 14.863 -6393.5
## - heatingqc      4   0.17484 15.077 -6392.6
## - bsmtexposure   4   0.18068 15.083 -6392.0
## - saletype       8   0.26570 15.168 -6391.8
## - heating        5   0.20899 15.111 -6391.3
## - fireplaces     1   0.17012 15.072 -6387.1
## - kitchenqual    3   0.24794 15.150 -6383.5
## - lotarea        1   0.22261 15.125 -6382.0
## - exterior1st   14   0.52327 15.426 -6379.2
## - totalbsmtsf    1   0.25871 15.161 -6378.5
## - bldgtype       4   0.32965 15.232 -6377.7
## - salecondition  5   0.40936 15.312 -6372.1
## - condition1     8   0.49078 15.393 -6370.3
## - yearbuilt      1   0.42906 15.331 -6362.2
## - grlivarea      1   0.48210 15.384 -6357.1
## - x2ndflrsf      1   0.65629 15.559 -6340.7
## - functional     6   0.91933 15.822 -6326.2
## - x1stflrsf      1   0.90879 15.811 -6317.2
## - neighborhood  24   1.52488 16.427 -6307.4
## - mszoning       4   1.13952 16.042 -6302.0
## - overallqual    1   1.22798 16.130 -6288.0
## - overallcond    1   1.46436 16.367 -6266.8
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6404.66
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtunfsf + totalbsmtsf + heating + heatingqc + 
##     x1stflrsf + x2ndflrsf + grlivarea + bsmtfullbath + fullbath + 
##     halfbath + bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + garagetype + garageyrblt + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - bsmtqual       4   0.06368 14.976 -6406.4
## - bedroomabvgr   1   0.00322 14.915 -6406.3
## - totrmsabvgrd   1   0.00338 14.916 -6406.3
## - garageyrblt    1   0.00460 14.917 -6406.2
## - masvnrtype     3   0.05213 14.964 -6405.6
## - fullbath       1   0.01633 14.929 -6405.1
## - landcontour    3   0.05938 14.972 -6404.9
## <none>                       14.912 -6404.7
## - lotfrontage    1   0.02052 14.933 -6404.6
## - garagetype     6   0.12461 15.037 -6404.5
## - bsmtfinsf1     1   0.02739 14.940 -6404.0
## - masvnrarea     1   0.03437 14.947 -6403.3
## - enclosedporch  1   0.03574 14.948 -6403.2
## - garagearea     1   0.03592 14.948 -6403.1
## - halfbath       1   0.04380 14.956 -6402.4
## - bsmtunfsf      1   0.04602 14.958 -6402.2
## + landslope      2   0.00988 14.902 -6401.6
## + lotshape       3   0.02640 14.886 -6401.2
## - extercond      4   0.12218 15.034 -6400.7
## - openporchsf    1   0.06242 14.975 -6400.6
## - lotconfig      4   0.12629 15.039 -6400.3
## + housestyle     7   0.09698 14.815 -6400.2
## - yearremodadd   1   0.07097 14.983 -6399.7
## + electrical     5   0.04813 14.864 -6399.4
## + exterqual      3   0.00627 14.906 -6399.3
## - foundation     5   0.15942 15.072 -6399.1
## - garagecars     1   0.07829 14.991 -6399.0
## - bsmtfullbath   1   0.08123 14.993 -6398.7
## + fireplacequ    5   0.04057 14.872 -6398.6
## - wooddecksf     1   0.08584 14.998 -6398.3
## + roofstyle      5   0.01987 14.892 -6396.6
## + bsmtfintype2   6   0.03882 14.873 -6396.5
## - heatingqc      4   0.17554 15.088 -6395.6
## - saletype       8   0.26203 15.174 -6395.2
## - heating        5   0.20606 15.118 -6394.6
## - bsmtexposure   4   0.20027 15.113 -6393.2
## - fireplaces     1   0.17190 15.084 -6389.9
## - kitchenqual    3   0.24598 15.158 -6386.8
## - lotarea        1   0.22563 15.138 -6384.7
## - exterior1st   14   0.52759 15.440 -6381.9
## - totalbsmtsf    1   0.25609 15.168 -6381.8
## - bldgtype       4   0.34234 15.255 -6379.5
## - salecondition  5   0.40956 15.322 -6375.1
## - condition1     8   0.48910 15.401 -6373.5
## - yearbuilt      1   0.43065 15.343 -6365.1
## - grlivarea      1   0.49168 15.404 -6359.3
## - x2ndflrsf      1   0.65754 15.570 -6343.7
## - functional     6   0.91600 15.828 -6329.6
## - x1stflrsf      1   0.92276 15.835 -6319.0
## - neighborhood  24   1.54128 16.453 -6309.1
## - mszoning       4   1.13448 16.047 -6305.6
## - overallqual    1   1.21910 16.131 -6291.9
## - overallcond    1   1.47102 16.383 -6269.3
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6406.43
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     bedroomabvgr + kitchenqual + totrmsabvgrd + functional + 
##     fireplaces + garagetype + garageyrblt + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - bedroomabvgr   1   0.00076 14.977 -6408.4
## - totrmsabvgrd   1   0.00290 14.979 -6408.2
## - garageyrblt    1   0.00564 14.982 -6407.9
## - masvnrtype     3   0.05500 15.031 -6407.1
## - landcontour    3   0.05853 15.034 -6406.7
## - fullbath       1   0.01795 14.994 -6406.7
## <none>                       14.976 -6406.4
## - garagetype     6   0.12776 15.104 -6406.0
## - lotfrontage    1   0.02538 15.001 -6406.0
## - masvnrarea     1   0.03041 15.006 -6405.5
## - bsmtfinsf1     1   0.03246 15.008 -6405.3
## - garagearea     1   0.03473 15.011 -6405.1
## - enclosedporch  1   0.03705 15.013 -6404.8
## + bsmtqual       4   0.06368 14.912 -6404.7
## - halfbath       1   0.04360 15.020 -6404.2
## - bsmtunfsf      1   0.04365 15.020 -6404.2
## + landslope      2   0.00968 14.966 -6403.4
## + lotshape       3   0.02620 14.950 -6403.0
## - extercond      4   0.12058 15.097 -6402.7
## + housestyle     7   0.09507 14.881 -6401.7
## - lotconfig      4   0.13123 15.107 -6401.7
## - openporchsf    1   0.07044 15.046 -6401.6
## - yearremodadd   1   0.07345 15.049 -6401.3
## + exterqual      3   0.00783 14.968 -6401.2
## - foundation     5   0.15770 15.134 -6401.1
## + electrical     5   0.04785 14.928 -6401.1
## + fireplacequ    5   0.04646 14.929 -6401.0
## - bsmtfullbath   1   0.08324 15.059 -6400.3
## - garagecars     1   0.08588 15.062 -6400.1
## - wooddecksf     1   0.09392 15.070 -6399.3
## + roofstyle      5   0.01957 14.956 -6398.3
## + bsmtfintype2   6   0.03520 14.941 -6397.9
## - heatingqc      4   0.17653 15.152 -6397.3
## - saletype       8   0.26482 15.241 -6396.8
## - heating        5   0.20576 15.182 -6396.5
## - bsmtexposure   4   0.21843 15.194 -6393.3
## - fireplaces     1   0.16265 15.139 -6392.7
## - lotarea        1   0.21787 15.194 -6387.3
## - totalbsmtsf    1   0.25382 15.230 -6383.9
## - exterior1st   14   0.53020 15.506 -6383.6
## - kitchenqual    3   0.30782 15.284 -6382.7
## - bldgtype       4   0.35536 15.331 -6380.2
## - salecondition  5   0.41843 15.394 -6376.2
## - condition1     8   0.49839 15.474 -6374.6
## - grlivarea      1   0.47694 15.453 -6362.7
## - yearbuilt      1   0.50305 15.479 -6360.2
## - x2ndflrsf      1   0.69657 15.672 -6342.1
## - functional     6   0.91229 15.888 -6332.1
## - x1stflrsf      1   0.97633 15.952 -6316.2
## - neighborhood  24   1.56467 16.541 -6309.3
## - mszoning       4   1.12883 16.105 -6308.3
## - overallqual    1   1.31110 16.287 -6285.9
## - overallcond    1   1.45436 16.430 -6273.1
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6408.36
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     kitchenqual + totrmsabvgrd + functional + fireplaces + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - totrmsabvgrd   1   0.00221 14.979 -6410.1
## - garageyrblt    1   0.00553 14.982 -6409.8
## - masvnrtype     3   0.05513 15.032 -6409.0
## - landcontour    3   0.05833 15.035 -6408.7
## - fullbath       1   0.01912 14.996 -6408.5
## <none>                       14.977 -6408.4
## - garagetype     6   0.12706 15.104 -6408.0
## - lotfrontage    1   0.02549 15.002 -6407.9
## - masvnrarea     1   0.03054 15.007 -6407.4
## - bsmtfinsf1     1   0.03217 15.009 -6407.2
## - garagearea     1   0.03414 15.011 -6407.0
## - enclosedporch  1   0.03784 15.014 -6406.7
## + bedroomabvgr   1   0.00076 14.976 -6406.4
## + bsmtqual       4   0.06121 14.915 -6406.3
## - halfbath       1   0.04333 15.020 -6406.1
## - bsmtunfsf      1   0.04355 15.020 -6406.1
## + landslope      2   0.00984 14.967 -6405.3
## + lotshape       3   0.02633 14.950 -6404.9
## - extercond      4   0.11985 15.097 -6404.7
## - lotconfig      4   0.13065 15.107 -6403.7
## - openporchsf    1   0.07001 15.047 -6403.6
## + housestyle     7   0.09306 14.884 -6403.5
## - yearremodadd   1   0.07272 15.049 -6403.3
## + exterqual      3   0.00776 14.969 -6403.1
## - foundation     5   0.15819 15.135 -6403.0
## + electrical     5   0.04743 14.929 -6403.0
## + fireplacequ    5   0.04648 14.930 -6402.9
## - bsmtfullbath   1   0.08307 15.060 -6402.3
## - garagecars     1   0.08641 15.063 -6402.0
## - wooddecksf     1   0.09387 15.070 -6401.2
## + roofstyle      5   0.01975 14.957 -6400.3
## + bsmtfintype2   6   0.03452 14.942 -6399.7
## - heatingqc      4   0.17587 15.152 -6399.3
## - saletype       8   0.26462 15.241 -6398.8
## - heating        5   0.20775 15.184 -6398.2
## - bsmtexposure   4   0.21772 15.194 -6395.3
## - fireplaces     1   0.16190 15.139 -6394.7
## - lotarea        1   0.21769 15.194 -6389.3
## - totalbsmtsf    1   0.25379 15.230 -6385.8
## - exterior1st   14   0.52957 15.506 -6385.6
## - kitchenqual    3   0.30751 15.284 -6384.7
## - bldgtype       4   0.35838 15.335 -6381.8
## - salecondition  5   0.41953 15.396 -6378.0
## - condition1     8   0.49766 15.474 -6376.6
## - grlivarea      1   0.47745 15.454 -6364.5
## - yearbuilt      1   0.50679 15.483 -6361.8
## - x2ndflrsf      1   0.70913 15.686 -6342.8
## - functional     6   0.91451 15.891 -6333.8
## - x1stflrsf      1   0.98030 15.957 -6317.8
## - neighborhood  24   1.57177 16.548 -6310.7
## - mszoning       4   1.13124 16.108 -6310.0
## - overallqual    1   1.31273 16.289 -6287.7
## - overallcond    1   1.46005 16.437 -6274.5
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6410.14
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     kitchenqual + functional + fireplaces + garagetype + garageyrblt + 
##     garagecars + garagearea + wooddecksf + openporchsf + enclosedporch + 
##     saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - garageyrblt    1   0.00540 14.984 -6411.6
## - masvnrtype     3   0.05379 15.033 -6410.9
## - fullbath       1   0.01793 14.997 -6410.4
## - landcontour    3   0.06028 15.039 -6410.3
## <none>                       14.979 -6410.1
## - garagetype     6   0.12652 15.105 -6409.9
## - lotfrontage    1   0.02527 15.004 -6409.7
## - masvnrarea     1   0.03077 15.010 -6409.1
## - bsmtfinsf1     1   0.03263 15.011 -6409.0
## - garagearea     1   0.03463 15.014 -6408.8
## - enclosedporch  1   0.03799 15.017 -6408.4
## + totrmsabvgrd   1   0.00221 14.977 -6408.4
## + bsmtqual       4   0.06180 14.917 -6408.2
## + bedroomabvgr   1   0.00007 14.979 -6408.2
## - halfbath       1   0.04329 15.022 -6407.9
## - bsmtunfsf      1   0.04408 15.023 -6407.9
## + landslope      2   0.01056 14.968 -6407.2
## + lotshape       3   0.02658 14.952 -6406.7
## - extercond      4   0.12050 15.099 -6406.4
## - openporchsf    1   0.06903 15.048 -6405.4
## - lotconfig      4   0.13181 15.111 -6405.4
## + housestyle     7   0.09314 14.886 -6405.3
## - yearremodadd   1   0.07239 15.051 -6405.1
## - foundation     5   0.15728 15.136 -6404.9
## + exterqual      3   0.00724 14.972 -6404.9
## + electrical     5   0.04675 14.932 -6404.7
## + fireplacequ    5   0.04478 14.934 -6404.5
## - bsmtfullbath   1   0.08200 15.061 -6404.2
## - garagecars     1   0.08611 15.065 -6403.8
## - wooddecksf     1   0.09402 15.073 -6403.0
## + roofstyle      5   0.02047 14.958 -6402.1
## + bsmtfintype2   6   0.03482 14.944 -6401.5
## - heatingqc      4   0.17538 15.154 -6401.1
## - saletype       8   0.26356 15.242 -6400.7
## - heating        5   0.20792 15.187 -6400.0
## - bsmtexposure   4   0.22125 15.200 -6396.7
## - fireplaces     1   0.16222 15.141 -6396.4
## - lotarea        1   0.21660 15.195 -6391.2
## - totalbsmtsf    1   0.25335 15.232 -6387.7
## - exterior1st   14   0.53074 15.510 -6387.3
## - kitchenqual    3   0.30529 15.284 -6386.7
## - bldgtype       4   0.35898 15.338 -6383.6
## - salecondition  5   0.42108 15.400 -6379.7
## - condition1     8   0.50134 15.480 -6378.1
## - grlivarea      1   0.48575 15.465 -6365.6
## - yearbuilt      1   0.51255 15.491 -6363.0
## - x2ndflrsf      1   0.75011 15.729 -6340.8
## - functional     6   0.91316 15.892 -6335.7
## - x1stflrsf      1   0.99143 15.970 -6318.6
## - mszoning       4   1.13402 16.113 -6311.6
## - neighborhood  24   1.58911 16.568 -6310.9
## - overallqual    1   1.31185 16.291 -6289.6
## - overallcond    1   1.46031 16.439 -6276.3
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
## 
## Step:  AIC=-6411.62
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrtype + 
##     masvnrarea + extercond + foundation + bsmtexposure + bsmtfinsf1 + 
##     bsmtunfsf + totalbsmtsf + heating + heatingqc + x1stflrsf + 
##     x2ndflrsf + grlivarea + bsmtfullbath + fullbath + halfbath + 
##     kitchenqual + functional + fireplaces + garagetype + garagecars + 
##     garagearea + wooddecksf + openporchsf + enclosedporch + saletype + 
##     salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - masvnrtype     3   0.05412 15.038 -6412.4
## - landcontour    3   0.05989 15.044 -6411.8
## - fullbath       1   0.01964 15.004 -6411.7
## <none>                       14.984 -6411.6
## - lotfrontage    1   0.02429 15.009 -6411.3
## - bsmtfinsf1     1   0.03212 15.016 -6410.5
## - masvnrarea     1   0.03229 15.017 -6410.5
## + garageyrblt    1   0.00540 14.979 -6410.1
## - enclosedporch  1   0.03839 15.023 -6409.9
## + totrmsabvgrd   1   0.00208 14.982 -6409.8
## + bsmtqual       4   0.06291 14.921 -6409.8
## + bedroomabvgr   1   0.00005 14.984 -6409.6
## - halfbath       1   0.04434 15.029 -6409.3
## - bsmtunfsf      1   0.04481 15.029 -6409.3
## - garagearea     1   0.04791 15.032 -6409.0
## + landslope      2   0.01090 14.973 -6408.7
## + lotshape       3   0.02690 14.957 -6408.2
## - extercond      4   0.12024 15.104 -6408.0
## - garagetype     6   0.16605 15.150 -6407.5
## + housestyle     7   0.09477 14.889 -6406.9
## - openporchsf    1   0.06988 15.054 -6406.8
## - lotconfig      4   0.13430 15.119 -6406.6
## + exterqual      3   0.00709 14.977 -6406.3
## + electrical     5   0.04773 14.937 -6406.3
## - foundation     5   0.15983 15.144 -6406.1
## + fireplacequ    5   0.04463 14.940 -6406.0
## - yearremodadd   1   0.07937 15.064 -6405.9
## - bsmtfullbath   1   0.08043 15.065 -6405.8
## - garagecars     1   0.08678 15.071 -6405.2
## - wooddecksf     1   0.09898 15.083 -6404.0
## + roofstyle      5   0.02152 14.963 -6403.7
## + bsmtfintype2   6   0.03401 14.950 -6402.9
## - heatingqc      4   0.17837 15.163 -6402.3
## - saletype       8   0.26466 15.249 -6402.1
## - heating        5   0.20442 15.189 -6401.8
## - bsmtexposure   4   0.21991 15.204 -6398.3
## - fireplaces     1   0.15840 15.143 -6398.3
## - lotarea        1   0.21251 15.197 -6393.1
## - totalbsmtsf    1   0.25245 15.237 -6389.2
## - exterior1st   14   0.52670 15.511 -6389.2
## - kitchenqual    3   0.30609 15.290 -6388.1
## - bldgtype       4   0.35699 15.341 -6385.2
## - salecondition  5   0.42244 15.407 -6381.0
## - condition1     8   0.50162 15.486 -6379.5
## - grlivarea      1   0.48938 15.474 -6366.7
## - yearbuilt      1   0.56699 15.551 -6359.4
## - x2ndflrsf      1   0.74480 15.729 -6342.8
## - functional     6   0.91717 15.901 -6336.9
## - x1stflrsf      1   0.98793 15.972 -6320.4
## - mszoning       4   1.12954 16.114 -6313.5
## - neighborhood  24   1.58420 16.569 -6312.9
## - overallqual    1   1.31484 16.299 -6290.8
## - overallcond    1   1.45521 16.439 -6278.3
## 
## Step:  AIC=-6412.36
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + masvnrarea + 
##     extercond + foundation + bsmtexposure + bsmtfinsf1 + bsmtunfsf + 
##     totalbsmtsf + heating + heatingqc + x1stflrsf + x2ndflrsf + 
##     grlivarea + bsmtfullbath + fullbath + halfbath + kitchenqual + 
##     functional + fireplaces + garagetype + garagecars + garagearea + 
##     wooddecksf + openporchsf + enclosedporch + saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## - masvnrarea     1   0.01632 15.055 -6412.8
## - landcontour    3   0.06139 15.100 -6412.4
## <none>                       15.038 -6412.4
## - fullbath       1   0.02094 15.059 -6412.3
## - lotfrontage    1   0.02180 15.060 -6412.2
## + masvnrtype     3   0.05412 14.984 -6411.6
## + garageyrblt    1   0.00573 15.033 -6410.9
## + bsmtqual       4   0.06529 14.973 -6410.7
## - halfbath       1   0.03917 15.078 -6410.6
## - bsmtfinsf1     1   0.03924 15.078 -6410.6
## + totrmsabvgrd   1   0.00079 15.038 -6410.4
## - bsmtunfsf      1   0.04058 15.079 -6410.4
## - enclosedporch  1   0.04090 15.079 -6410.4
## + bedroomabvgr   1   0.00023 15.038 -6410.4
## - garagearea     1   0.04229 15.081 -6410.3
## - garagetype     6   0.15499 15.193 -6409.4
## + landslope      2   0.01048 15.028 -6409.4
## - extercond      4   0.12048 15.159 -6408.7
## + lotshape       3   0.02300 15.015 -6408.6
## - lotconfig      4   0.13045 15.169 -6407.7
## - openporchsf    1   0.06936 15.108 -6407.6
## + housestyle     7   0.09025 14.948 -6407.1
## + electrical     5   0.04733 14.991 -6407.0
## + fireplacequ    5   0.04722 14.991 -6406.9
## - foundation     5   0.16054 15.199 -6406.9
## + exterqual      3   0.00491 15.034 -6406.8
## - yearremodadd   1   0.07994 15.118 -6406.6
## - bsmtfullbath   1   0.08299 15.121 -6406.3
## - garagecars     1   0.09924 15.138 -6404.8
## - wooddecksf     1   0.10074 15.139 -6404.6
## + roofstyle      5   0.02134 15.017 -6404.4
## + bsmtfintype2   6   0.03418 15.004 -6403.7
## - saletype       8   0.26179 15.300 -6403.2
## - heating        5   0.20525 15.244 -6402.6
## - heatingqc      4   0.18462 15.223 -6402.5
## - bsmtexposure   4   0.22512 15.264 -6398.7
## - fireplaces     1   0.16491 15.203 -6398.4
## - lotarea        1   0.20808 15.246 -6394.3
## - exterior1st   14   0.50839 15.547 -6391.8
## - totalbsmtsf    1   0.24078 15.279 -6391.2
## - kitchenqual    3   0.29526 15.334 -6390.0
## - bldgtype       4   0.33350 15.372 -6388.3
## - salecondition  5   0.42111 15.460 -6382.0
## - condition1     8   0.50984 15.548 -6379.7
## - grlivarea      1   0.48344 15.522 -6368.2
## - yearbuilt      1   0.58614 15.624 -6358.5
## - x2ndflrsf      1   0.74265 15.781 -6344.0
## - functional     6   0.92415 15.963 -6337.3
## - x1stflrsf      1   1.00402 16.042 -6320.0
## - mszoning       4   1.11138 16.150 -6316.3
## - neighborhood  24   1.59800 16.636 -6312.9
## - overallqual    1   1.37780 16.416 -6286.4
## - overallcond    1   1.44613 16.485 -6280.3
## 
## Step:  AIC=-6412.77
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + extercond + 
##     foundation + bsmtexposure + bsmtfinsf1 + bsmtunfsf + totalbsmtsf + 
##     heating + heatingqc + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + kitchenqual + functional + 
##     fireplaces + garagetype + garagecars + garagearea + wooddecksf + 
##     openporchsf + enclosedporch + saletype + salecondition
## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated

## Warning in `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels)
## else paste0(labels, : duplicated levels in factors are deprecated
##                 Df Sum of Sq    RSS     AIC
## <none>                       15.055 -6412.8
## - fullbath       1   0.02099 15.076 -6412.7
## - landcontour    3   0.06424 15.119 -6412.6
## - lotfrontage    1   0.02382 15.079 -6412.5
## + masvnrarea     1   0.01632 15.038 -6412.4
## + garageyrblt    1   0.00682 15.048 -6411.4
## - bsmtfinsf1     1   0.03616 15.091 -6411.3
## - halfbath       1   0.03691 15.092 -6411.2
## - garagearea     1   0.03872 15.093 -6411.0
## + bsmtqual       4   0.06363 14.991 -6411.0
## + totrmsabvgrd   1   0.00100 15.054 -6410.9
## - enclosedporch  1   0.04085 15.096 -6410.8
## + bedroomabvgr   1   0.00016 15.055 -6410.8
## - bsmtunfsf      1   0.04275 15.098 -6410.6
## + masvnrtype     3   0.03815 15.017 -6410.5
## + landslope      2   0.00964 15.045 -6409.7
## - garagetype     6   0.15730 15.212 -6409.6
## - extercond      4   0.12115 15.176 -6409.1
## + lotshape       3   0.02353 15.031 -6409.1
## - lotconfig      4   0.13046 15.185 -6408.2
## - openporchsf    1   0.07056 15.125 -6407.9
## + housestyle     7   0.09246 14.962 -6407.8
## + electrical     5   0.04836 15.006 -6407.5
## + fireplacequ    5   0.04732 15.007 -6407.4
## - foundation     5   0.16035 15.215 -6407.3
## + exterqual      3   0.00396 15.051 -6407.2
## - yearremodadd   1   0.08339 15.138 -6406.7
## - bsmtfullbath   1   0.08641 15.141 -6406.4
## - garagecars     1   0.09624 15.151 -6405.5
## - wooddecksf     1   0.09912 15.154 -6405.2
## + roofstyle      5   0.02236 15.032 -6404.9
## + bsmtfintype2   6   0.03330 15.021 -6404.0
## - saletype       8   0.26075 15.316 -6403.7
## - heatingqc      4   0.18284 15.238 -6403.1
## - heating        5   0.20658 15.261 -6402.9
## - bsmtexposure   4   0.22182 15.277 -6399.4
## - fireplaces     1   0.16082 15.216 -6399.3
## - lotarea        1   0.21061 15.265 -6394.5
## - totalbsmtsf    1   0.24209 15.297 -6391.5
## - kitchenqual    3   0.28735 15.342 -6391.2
## - exterior1st   14   0.52650 15.581 -6390.6
## - bldgtype       4   0.33868 15.393 -6388.3
## - salecondition  5   0.41736 15.472 -6382.8
## - condition1     8   0.51485 15.570 -6379.7
## - grlivarea      1   0.47278 15.527 -6369.6
## - yearbuilt      1   0.57588 15.631 -6360.0
## - x2ndflrsf      1   0.74993 15.805 -6343.8
## - functional     6   0.91867 15.973 -6338.3
## - x1stflrsf      1   1.00807 16.063 -6320.1
## - mszoning       4   1.11271 16.167 -6316.7
## - neighborhood  24   1.58189 16.637 -6314.9
## - overallqual    1   1.36595 16.421 -6288.0
## - overallcond    1   1.44855 16.503 -6280.6
    step$anova # display results 
## Stepwise Model Path 
## Analysis of Deviance Table
## 
## Initial Model:
## log_saleprice ~ mszoning + lotfrontage + lotarea + lotshape + 
##     landcontour + lotconfig + landslope + neighborhood + condition1 + 
##     bldgtype + housestyle + overallqual + overallcond + yearbuilt + 
##     yearremodadd + roofstyle + exterior1st + masvnrtype + masvnrarea + 
##     exterqual + extercond + foundation + bsmtqual + bsmtexposure + 
##     bsmtfinsf1 + bsmtfintype2 + bsmtunfsf + totalbsmtsf + heating + 
##     heatingqc + electrical + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + bedroomabvgr + kitchenqual + 
##     totrmsabvgrd + functional + fireplaces + fireplacequ + garagetype + 
##     garageyrblt + garagecars + garagearea + wooddecksf + openporchsf + 
##     enclosedporch + saletype + salecondition
## 
## Final Model:
## log_saleprice ~ mszoning + lotfrontage + lotarea + landcontour + 
##     lotconfig + neighborhood + condition1 + bldgtype + overallqual + 
##     overallcond + yearbuilt + yearremodadd + exterior1st + extercond + 
##     foundation + bsmtexposure + bsmtfinsf1 + bsmtunfsf + totalbsmtsf + 
##     heating + heatingqc + x1stflrsf + x2ndflrsf + grlivarea + 
##     bsmtfullbath + fullbath + halfbath + kitchenqual + functional + 
##     fireplaces + garagetype + garagecars + garagearea + wooddecksf + 
##     openporchsf + enclosedporch + saletype + salecondition
## 
## 
##              Step Df     Deviance Resid. Df Resid. Dev       AIC
## 1                                      1280   14.60957 -6362.592
## 2     - roofstyle  5 0.0164471490      1285   14.62602 -6370.949
## 3  - bsmtfintype2  6 0.0514553388      1291   14.67747 -6377.822
## 4   - fireplacequ  5 0.0445989385      1296   14.72207 -6383.392
## 5     - exterqual  3 0.0045736392      1299   14.72664 -6388.939
## 6    - electrical  5 0.0460971660      1304   14.77274 -6394.376
## 7    - housestyle  7 0.1038392696      1311   14.87658 -6398.149
## 8      - lotshape  3 0.0257587607      1314   14.90234 -6401.623
## 9     - landslope  2 0.0098829354      1316   14.91222 -6404.655
## 10     - bsmtqual  4 0.0636765775      1320   14.97590 -6406.434
## 11 - bedroomabvgr  1 0.0007551971      1321   14.97665 -6408.361
## 12 - totrmsabvgrd  1 0.0022125584      1322   14.97887 -6410.145
## 13  - garageyrblt  1 0.0053959178      1323   14.98426 -6411.619
## 14   - masvnrtype  3 0.0541228596      1326   15.03839 -6412.355
## 15   - masvnrarea  1 0.0163195466      1327   15.05471 -6412.772
    plot(predict(fit_both, newdata = test_homes))

    test_homes$pred_both_log_saleprice <- predict(fit_both, newdata = test_homes)
    
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# ...   submittal file - both selection
# ...   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    df_submit_both <- data.frame(test_homes$id, exp(test_homes$pred_both_log_saleprice))
    names(df_submit_both) <- c("Id", "SalePrice")
    
    df_submit_both$SalePrice[is.na(df_submit_both$SalePrice)] <- median(df_submit_both$SalePrice, na.rm = TRUE)

    write.csv(df_submit_both, file = "submit_test_pred_both_selection.csv", row.names = FALSE)